[android] convert place page to fragment #4174
|
@ -51,26 +51,26 @@
|
|||
android:paddingBottom="@dimen/margin_base"
|
||||
android:visibility="invisible" />
|
||||
</RelativeLayout>
|
||||
<app.organicmaps.widget.placepage.PlacePageView
|
||||
<androidx.core.widget.NestedScrollViewClickFixed
|
||||
android:id="@+id/placepage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?attr/bottomSheetStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fillViewport="true"
|
||||
app:layout_behavior="@string/placepage_behavior" />
|
||||
<FrameLayout
|
||||
android:id="@+id/pp_buttons_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="?ppButtonsBackground"
|
||||
android:visibility="invisible">
|
||||
<LinearLayout
|
||||
android:id="@+id/container"
|
||||
app:layout_behavior="@string/placepage_behavior" >
|
||||
<RelativeLayout
|
||||
android:id="@+id/placepage_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/place_page_buttons_height"
|
||||
android:orientation="horizontal" />
|
||||
<include layout="@layout/divider_horizontal" />
|
||||
</FrameLayout>
|
||||
<include layout="@layout/elevation_profile_bottom_sheet" />
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?panel" >
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/placepage_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</RelativeLayout>
|
||||
</androidx.core.widget.NestedScrollViewClickFixed>
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/pp_buttons_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginTop="@dimen/margin_quarter"
|
||||
android:layout_marginBottom="@dimen/margin_eighth"
|
||||
android:layout_marginBottom="@dimen/margin_half"
|
||||
android:src="@drawable/bottom_sheet_handle"
|
||||
app:tint="?colorControlHighlight" />
|
||||
|
||||
|
|
|
@ -1,23 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/pp__preview"
|
||||
layout="@layout/place_page_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/pp__preview"
|
||||
layout="@layout/place_page_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<include
|
||||
android:id="@+id/pp__details_frame"
|
||||
layout="@layout/place_page_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?panel"/>
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:id="@+id/pp__details_frame"
|
||||
layout="@layout/place_page_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -2,17 +2,20 @@
|
|||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/bookmark_frame"
|
||||
android:id="@+id/place_page_bookmark_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible">
|
||||
android:orientation="vertical">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/wv__bookmark_notes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:id="@+id/tv__bookmark_edit"
|
||||
style="@style/PlacePageMetadataText.Button"
|
||||
android:gravity="center"
|
||||
android:layout_height="@dimen/height_block_base"
|
||||
android:background="?clickableBackground"
|
||||
android:paddingEnd="@dimen/margin_base"
|
||||
android:paddingStart="@dimen/margin_base"
|
||||
android:text="@string/placepage_edit_bookmark_button"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__bookmark_notes"
|
||||
|
@ -25,16 +28,6 @@
|
|||
android:textAppearance="?android:attr/textAppearance"
|
||||
tools:text="Long, long text Long, long text Long, long text Long, long text Long, long text Long, long text "/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__bookmark_edit"
|
||||
style="@style/PlacePageMetadataText.Button"
|
||||
android:gravity="center"
|
||||
android:layout_height="@dimen/height_block_base"
|
||||
android:background="?clickableBackground"
|
||||
android:paddingEnd="@dimen/margin_base"
|
||||
android:paddingStart="@dimen/margin_base"
|
||||
android:text="@string/placepage_edit_bookmark_button"/>
|
||||
|
||||
<include
|
||||
layout="@layout/divider_horizontal"/>
|
||||
</LinearLayout>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
android:id="@+id/pp_description_header_container"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/margin_half_plus_eight"
|
||||
android:background="?windowBackgroundForced">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:paddingTop="@dimen/margin_quarter_plus"
|
||||
android:paddingBottom="@dimen/margin_quarter"
|
||||
android:text="@string/placepage_place_description"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:textAppearance="@style/TextAppearance.MdcTypographyStyles.Subtitle2"
|
||||
android:layout_alignParentStart="true" />
|
||||
</RelativeLayout>
|
|
@ -4,8 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?windowBackgroundForced"
|
||||
android:background="?panel"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/place_page_fat_shadow"/>
|
||||
|
@ -16,64 +15,48 @@
|
|||
android:background="?ppBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/place_page_description_header"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<include
|
||||
layout="@layout/place_page_bookmark_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<include
|
||||
layout="@layout/place_page_description_layout"
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/place_page_bookmark_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/margin_half"
|
||||
tools:visibility="visible"/>
|
||||
tools:layout="@layout/place_page_bookmark_fragment" />
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/place_page_wikipedia_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout="@layout/place_page_wikipedia_fragment" />
|
||||
|
||||
<include layout="@layout/place_page_placename"/>
|
||||
|
||||
<include layout="@layout/place_page_opening_hours"/>
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/place_page_opening_hours_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout="@layout/place_page_opening_hours_fragment" />
|
||||
|
||||
<include layout="@layout/place_page_cuisine"/>
|
||||
|
||||
<include layout="@layout/place_page_entrance"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rw__phone"
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/place_page_phone_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?cardBackground"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
|
||||
tools:layout="@layout/place_page_phone_fragment" />
|
||||
|
||||
<include layout="@layout/place_page_operator"/>
|
||||
|
||||
<include layout="@layout/place_page_website"/>
|
||||
|
||||
<include layout="@layout/place_page_wifi"/>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/place_page_links_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout="@layout/place_page_links_fragment" />
|
||||
|
||||
<include layout="@layout/place_page_level" />
|
||||
|
||||
<include layout="@layout/place_page_email"/>
|
||||
|
||||
<include layout="@layout/place_page_facebook"/>
|
||||
|
||||
<include layout="@layout/place_page_instagram"/>
|
||||
|
||||
<include layout="@layout/place_page_twitter"/>
|
||||
|
||||
<include layout="@layout/place_page_vk"/>
|
||||
|
||||
<include layout="@layout/place_page_line"/>
|
||||
|
||||
<include layout="@layout/place_page_wiki"/>
|
||||
|
||||
<include layout="@layout/place_page_wikimedia"/>
|
||||
|
||||
<!-- ToDo: Address is missing compared with iOS. It's shown in title but anyway .. -->
|
||||
|
||||
<include layout="@layout/place_page_latlon"/>
|
||||
|
|
15
android/res/layout/place_page_links_fragment.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<include layout="@layout/place_page_website" />
|
||||
<include layout="@layout/place_page_email" />
|
||||
<include layout="@layout/place_page_facebook" />
|
||||
<include layout="@layout/place_page_instagram" />
|
||||
<include layout="@layout/place_page_twitter" />
|
||||
<include layout="@layout/place_page_vk" />
|
||||
<include layout="@layout/place_page_line" />
|
||||
<include layout="@layout/place_page_wikimedia" />
|
||||
</LinearLayout>
|
|
@ -3,7 +3,6 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll__place_schedule"
|
||||
style="@style/PlacePageItemFrame"
|
||||
android:tag="schedule">
|
||||
|
13
android/res/layout/place_page_phone_fragment.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rw__phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?cardBackground"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
</LinearLayout>
|
|
@ -6,6 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:background="?ppBackground"
|
||||
android:paddingBottom="@dimen/margin_quarter">
|
||||
|
||||
<include
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll__place_wiki"
|
||||
style="@style/PlacePageItemFrame"
|
||||
android:tag="wiki"
|
||||
tools:background="#20FF0000"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv__place_wiki"
|
||||
style="@style/PlacePageMetadataIcon"
|
||||
android:src="@drawable/ic_wiki"
|
||||
app:tint="?colorAccent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__place_wiki"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/MwmTextAppearance.PlacePage.Accent"
|
||||
android:text="@string/read_in_wikipedia"/>
|
||||
</LinearLayout>
|
32
android/res/layout/place_page_wikipedia_fragment.xml
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:id="@+id/ll__place_wiki"
|
||||
style="@style/PlacePageItemFrame"
|
||||
android:visibility="visible"
|
||||
tools:background="#20FF0000">
|
||||
<ImageView
|
||||
android:id="@+id/iv__place_wiki"
|
||||
style="@style/PlacePageMetadataIcon"
|
||||
android:src="@drawable/ic_wiki"
|
||||
app:tint="?colorAccent" />
|
||||
<TextView
|
||||
android:id="@+id/tv__place_wiki"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/read_in_wikipedia"
|
||||
android:textAppearance="@style/MwmTextAppearance.PlacePage.Accent" />
|
||||
</LinearLayout>
|
||||
<include
|
||||
layout="@layout/place_page_description_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/margin_half"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
16
android/res/layout/pp_buttons_fragment.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/pp_buttons_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?ppButtonsBackground"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="bottom">
|
||||
<include layout="@layout/divider_horizontal" />
|
||||
<LinearLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/place_page_buttons_height"
|
||||
android:orientation="horizontal" />
|
||||
</RelativeLayout>
|
|
@ -122,7 +122,6 @@
|
|||
<dimen name="map_buttons_bottom_max_width">300dp</dimen>
|
||||
|
||||
<dimen name="appbar_elevation">4dp</dimen>
|
||||
<dimen name="placepage_elevation">4dp</dimen>
|
||||
|
||||
<dimen name="tabs_height">64dp</dimen>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="pp_title_lines">5</integer>
|
||||
<integer name="pp_buttons_max">4</integer>
|
||||
<integer name="pp_buttons_max">5</integer>
|
||||
<integer name="place_page_description_max_length">500</integer>
|
||||
</resources>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<item name="android:gravity">center</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:textSize">10sp</item>
|
||||
<item name="android:color">?iconTint</item>
|
||||
</style>
|
||||
|
||||
<style name="PlacePageButtonImage">
|
||||
|
@ -16,6 +17,7 @@
|
|||
<item name="android:paddingTop">@dimen/margin_base</item>
|
||||
<item name="android:paddingBottom">@dimen/margin_base</item>
|
||||
<item name="android:scaleType">center</item>
|
||||
<item name="android:color">?iconTint</item>
|
||||
</style>
|
||||
|
||||
<style name="PlacePageButton">
|
||||
|
|
|
@ -79,13 +79,12 @@ import app.organicmaps.settings.UnitLocale;
|
|||
import app.organicmaps.sound.TtsPlayer;
|
||||
import app.organicmaps.util.log.Logger;
|
||||
import app.organicmaps.widget.menu.MainMenu;
|
||||
import app.organicmaps.widget.placepage.PlacePageButtons;
|
||||
import app.organicmaps.widget.placepage.PlacePageController;
|
||||
import app.organicmaps.widget.placepage.PlacePageData;
|
||||
import app.organicmaps.widget.placepage.PlacePageFactory;
|
||||
import app.organicmaps.widget.placepage.RoutingModeListener;
|
||||
import app.organicmaps.widget.placepage.PlacePageView;
|
||||
import app.organicmaps.util.Config;
|
||||
import app.organicmaps.util.Counters;
|
||||
import app.organicmaps.util.LocationUtils;
|
||||
import app.organicmaps.util.SharingUtils;
|
||||
import app.organicmaps.util.ThemeSwitcher;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
|
@ -98,7 +97,6 @@ import java.util.ArrayList;
|
|||
import java.util.Objects;
|
||||
import java.util.Stack;
|
||||
|
||||
import static app.organicmaps.util.concurrency.UiThread.runLater;
|
||||
import static app.organicmaps.widget.placepage.PlacePageButtons.PLACEPAGE_MORE_MENU_ID;
|
||||
|
||||
public class MwmActivity extends BaseMwmFragmentActivity
|
||||
|
@ -114,10 +112,11 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
BookmarkManager.BookmarksLoadingListener,
|
||||
FloatingSearchToolbarController.SearchToolbarListener,
|
||||
PlacePageController.SlideListener,
|
||||
RoutingModeListener,
|
||||
NoConnectionListener,
|
||||
MenuBottomSheetFragment.MenuBottomSheetInterfaceWithHeader,
|
||||
ToggleMapLayerFragment.LayerItemClickListener
|
||||
ToggleMapLayerFragment.LayerItemClickListener,
|
||||
PlacePageButtons.PlacePageButtonClickListener,
|
||||
PlacePageView.PlacePageViewListener
|
||||
{
|
||||
private static final String TAG = MwmActivity.class.getSimpleName();
|
||||
|
||||
|
@ -152,6 +151,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
|
||||
private View mPointChooser;
|
||||
private Toolbar mPointChooserToolbar;
|
||||
|
||||
enum PointChooserMode
|
||||
{
|
||||
NONE,
|
||||
|
@ -384,10 +384,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
setContentView(R.layout.activity_map);
|
||||
UiUtils.setupTransparentStatusBar(this);
|
||||
|
||||
mPlacePageController = PlacePageFactory.createCompositePlacePageController(
|
||||
this, this);
|
||||
mPlacePageController = new PlacePageController(this, this);
|
||||
mPlacePageController.initialize(this);
|
||||
mPlacePageController.onActivityCreated(this, savedInstanceState);
|
||||
|
||||
mSearchController = new FloatingSearchToolbarController(this, this);
|
||||
mSearchController.getToolbar()
|
||||
|
@ -911,14 +909,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
RoutingController.get().rebuildLastRoute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleRouteSettings(@NonNull RoadType roadType)
|
||||
{
|
||||
closePlacePage();
|
||||
RoutingOptions.addOption(roadType);
|
||||
rebuildLastRouteInternal();
|
||||
}
|
||||
|
||||
private void onIsolinesStateChanged(@NonNull IsolinesState type)
|
||||
{
|
||||
if (type != IsolinesState.EXPIREDDATA)
|
||||
|
@ -1008,7 +998,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
mOnmapDownloader.onResume();
|
||||
|
||||
mNavigationController.onActivityResumed(this);
|
||||
mPlacePageController.onActivityResumed(this);
|
||||
refreshLightStatusBar();
|
||||
}
|
||||
|
||||
|
@ -1035,7 +1024,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
TtsPlayer.INSTANCE.stop();
|
||||
if (mOnmapDownloader != null)
|
||||
mOnmapDownloader.onPause();
|
||||
mPlacePageController.onActivityPaused(this);
|
||||
mNavigationController.onActivityPaused(this);
|
||||
super.onPause();
|
||||
}
|
||||
|
@ -1052,7 +1040,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
LocationState.nativeSetListener(this);
|
||||
LocationHelper.INSTANCE.addListener(this);
|
||||
onMyPositionModeChanged(LocationState.nativeGetMode());
|
||||
mPlacePageController.onActivityStarted(this);
|
||||
mSearchController.attach(this);
|
||||
if (!Config.isScreenSleepEnabled())
|
||||
Utils.keepScreenOn(true, getWindow());
|
||||
|
@ -1068,7 +1055,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
LocationState.nativeRemoveListener();
|
||||
LocationHelper.INSTANCE.detach();
|
||||
RoutingController.get().detach();
|
||||
mPlacePageController.onActivityStopped(this);
|
||||
IsolinesManager.from(getApplicationContext()).detach();
|
||||
mSearchController.detach();
|
||||
Utils.keepScreenOn(false, getWindow());
|
||||
|
@ -1819,7 +1805,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
return items;
|
||||
}
|
||||
else if (id.equals(PLACEPAGE_MORE_MENU_ID))
|
||||
return mPlacePageController.getMenuBottomSheetItems();
|
||||
return mPlacePageController.getMenuBottomSheetItems(id);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1831,4 +1817,36 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
return new ToggleMapLayerFragment();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageButtonClick(PlacePageButtons.ButtonType item)
|
||||
{
|
||||
mPlacePageController.onPlacePageButtonClick(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageContentChanged(int previewHeight, int frameHeight)
|
||||
{
|
||||
mPlacePageController.onPlacePageContentChanged(previewHeight, frameHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageRequestClose()
|
||||
{
|
||||
mPlacePageController.onPlacePageRequestClose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageRequestToggleState()
|
||||
{
|
||||
mPlacePageController.onPlacePageRequestToggleState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageRequestToggleRouteSettings(@NonNull RoadType roadType)
|
||||
{
|
||||
closePlacePage();
|
||||
RoutingOptions.addOption(roadType);
|
||||
rebuildLastRouteInternal();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
public interface Closable
|
||||
{
|
||||
void closePlacePage();
|
||||
}
|
|
@ -40,7 +40,10 @@ public class DefaultBottomSheetCallback extends BottomSheetBehavior.BottomSheetC
|
|||
return;
|
||||
}
|
||||
|
||||
mSheetChangedListener.onSheetCollapsed();
|
||||
if (PlacePageUtils.isCollapsedState(newState))
|
||||
{
|
||||
mSheetChangedListener.onSheetCollapsed();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -135,15 +135,15 @@ public class ElevationProfileViewRenderer implements PlacePageViewRenderer<Place
|
|||
@Override
|
||||
public void onSave(@NonNull Bundle outState)
|
||||
{
|
||||
outState.putParcelable(PlacePageUtils.EXTRA_PLACE_PAGE_DATA, mElevationInfo);
|
||||
// outState.putParcelable(PlacePageUtils.EXTRA_PLACE_PAGE_DATA, mElevationInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestore(@NonNull Bundle inState)
|
||||
{
|
||||
mElevationInfo = Utils.getParcelable(inState, PlacePageUtils.EXTRA_PLACE_PAGE_DATA, ElevationInfo.class);
|
||||
if (mElevationInfo != null)
|
||||
render(mElevationInfo);
|
||||
// mElevationInfo = Utils.getParcelable(inState, PlacePageUtils.EXTRA_PLACE_PAGE_DATA, ElevationInfo.class);
|
||||
// if (mElevationInfo != null)
|
||||
// render(mElevationInfo);
|
||||
}
|
||||
|
||||
![]() I don't really know, but it is currently unused and linked to organicmaps/organicmaps#2829 I don't really know, but it is currently unused and linked to https://git.omaps.dev/organicmaps/organicmaps/issues/2829
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,159 @@
|
|||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
package app.organicmaps.widget.placepage;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.content.Context;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.os.Bundle;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.text.TextUtils;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.text.util.Linkify;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.util.Base64;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.view.LayoutInflater;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.view.View;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.view.ViewGroup;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.webkit.WebSettings;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.webkit.WebView;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.widget.LinearLayout;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import android.widget.TextView;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import androidx.annotation.NonNull;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import androidx.annotation.Nullable;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import androidx.fragment.app.Fragment;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import androidx.lifecycle.Observer;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import app.organicmaps.R;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import app.organicmaps.bookmarks.data.Bookmark;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import app.organicmaps.bookmarks.data.BookmarkManager;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import app.organicmaps.bookmarks.data.MapObject;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import app.organicmaps.util.StringUtils;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import app.organicmaps.util.UiUtils;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
import app.organicmaps.util.Utils;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
public class PlacePageBookmarkFragment extends Fragment implements View.OnClickListener,
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
View.OnLongClickListener,
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
Observer<MapObject>,
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
EditBookmarkFragment.EditBookmarkListener
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
private View mFrame;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
private TextView mTvBookmarkNote;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Nullable
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
private WebView mWvBookmarkNote;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
private PlacePageViewModel viewModel;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
private Bookmark currentBookmark;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Nullable
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Override
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
return inflater.inflate(R.layout.place_page_bookmark_fragment, container, false);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Override
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
mFrame = view;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
mTvBookmarkNote = mFrame.findViewById(R.id.tv__bookmark_notes);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
mTvBookmarkNote.setOnLongClickListener(this);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
final View editBookmarkBtn = mFrame.findViewById(R.id.tv__bookmark_edit);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
editBookmarkBtn.setOnClickListener(this);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(PlacePageViewModel.class);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
viewModel.getMapObject().observe(requireActivity(), this);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
private void initWebView()
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
mWvBookmarkNote = new WebView(requireContext());
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
final WebSettings settings = mWvBookmarkNote.getSettings();
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
settings.setJavaScriptEnabled(false);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
settings.setDefaultTextEncodingName("UTF-8");
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
final LinearLayout linearLayout = mFrame.findViewById(R.id.place_page_bookmark_layout);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
// Add the webview in last position
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
linearLayout.addView(mWvBookmarkNote, linearLayout.getChildCount() - 1);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Override
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
public void onDestroy()
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
super.onDestroy();
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
viewModel.getMapObject().removeObserver(this);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
private void updateBookmarkDetails()
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
final String notes = currentBookmark.getBookmarkDescription();
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
if (TextUtils.isEmpty(notes))
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
UiUtils.hide(mTvBookmarkNote);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
if (mWvBookmarkNote != null)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
UiUtils.hide(mWvBookmarkNote);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
else if (StringUtils.nativeIsHtml(notes))
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
if (mWvBookmarkNote == null)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
initWebView();
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
// According to loadData documentation, HTML should be either base64 or percent encoded.
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
// Default UTF-8 encoding for all content is set above in WebSettings.
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
final String b64encoded = Base64.encodeToString(notes.getBytes(), Base64.DEFAULT);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
mWvBookmarkNote.loadData(b64encoded, Utils.TEXT_HTML, "base64");
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
UiUtils.show(mWvBookmarkNote);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
UiUtils.hide(mTvBookmarkNote);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
else
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
mTvBookmarkNote.setText(notes);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
Linkify.addLinks(mTvBookmarkNote, Linkify.ALL);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
UiUtils.show(mTvBookmarkNote);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
if (mWvBookmarkNote != null)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
UiUtils.hide(mWvBookmarkNote);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Override
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
public void onClick(View v)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
final FragmentActivity activity = requireActivity();
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
EditBookmarkFragment.editBookmark(currentBookmark.getCategoryId(),
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
currentBookmark.getBookmarkId(),
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
activity,
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
activity.getSupportFragmentManager(),
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
PlacePageBookmarkFragment.this);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Override
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
public boolean onLongClick(View v)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
final String notes = mTvBookmarkNote.getText().toString();
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
final Context ctx = requireContext();
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
Utils.copyTextToClipboard(ctx, notes);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
Utils.showSnackbarAbove(mFrame,
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
mFrame.getRootView().findViewById(R.id.pp_buttons_layout),
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
ctx.getString(R.string.copied_to_clipboard, notes));
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
return true;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Override
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
public void onChanged(MapObject mapObject)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
// MapObject could be something else than a bookmark if the user already has the place page
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
// opened and clicks on a non-bookmarked POI.
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
// This callback would be called before the fragment had time to be destroyed
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
if (mapObject.getMapObjectType() == MapObject.BOOKMARK)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
currentBookmark = (Bookmark) mapObject;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
updateBookmarkDetails();
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
@Override
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
public void onBookmarkSaved(long bookmarkId, boolean movedFromCategory)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
{
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
Bookmark updatedBookmark = BookmarkManager.INSTANCE.updateBookmarkPlacePage(bookmarkId);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
if (updatedBookmark == null)
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
return;
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
viewModel.setMapObject(updatedBookmark);
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
||||
}
|
||||
![]() ? ?
![]() This check should be done before calling initWebView() (it actually already exists there). This check should be done before calling initWebView() (it actually already exists there).
![]() Let's crash here and fix it? Let's crash here and fix it?
![]() nit: final here and in other places. nit: final here and in other places.
![]() Activity a = requireActivity() ? Activity a = requireActivity() ?
![]() When it can be null? Does crashing here help to debug wrong states? When it can be null? Does crashing here help to debug wrong states?
rtsisyk
commented
I also don't understand what is "description header". Could you please add a screenshot? I also don't understand what is "description header". Could you please add a screenshot?
rtsisyk
commented
`updateBookmarkDetails()` also checks for `if (mWvBookmarkNote != null)`
![]() Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark. Currently when a bookmark has a note or when a Wikipedia article is available, a grey rectangle with "Description" in it is shown above. With the current state of the refactoring, this header is not shown anymore for bookmark notes. This comment was a reminder for me of this change. I don't think bringing back this header is a good idea, but we should think of a better solution. For now I put the edit bookmark above the notes so we know the notes are linked with the bookmark.
![]() I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works. I'll look more into this, but when the place page is closed, the mapobject is set to null. The fragment should be destroyed but to make sure I added this check. I can try to remove it and see if it works.
![]() When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null. One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null. When the place page is closed, the mapObject is set to null. The controller detects when this value becomes null and destroys the fragments. But this means the fragments themselves could receive the event that the mapObject became null.
One way to fix this would be to destroy the fragments and then set the value to null, or never set it to null.
![]() Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space. Does it mean that the "description" header is displayed now only for Wiki articles? Let's remove it completely. It occupies an important PP space.
![]() Is it possible to unsubscribe first, before setting a null map object? If it's too complex to fix now, then please add your comment above to the code. Is it possible to unsubscribe first, before setting a null map object?
If it's too complex to fix now, then please add your comment above to the code.
|
|
@ -0,0 +1,40 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
public class PlacePageButton
|
||||
{
|
||||
@StringRes
|
||||
private final int mTitleId;
|
||||
@DrawableRes
|
||||
private final int mIconId;
|
||||
@NonNull
|
||||
private final PlacePageButtons.ButtonType mButtonType;
|
||||
|
||||
PlacePageButton(@StringRes int titleId, @DrawableRes int iconId, @NonNull PlacePageButtons.ButtonType buttonType)
|
||||
{
|
||||
mTitleId = titleId;
|
||||
mIconId = iconId;
|
||||
mButtonType = buttonType;
|
||||
}
|
||||
|
||||
@StringRes
|
||||
public int getTitle()
|
||||
{
|
||||
return mTitleId;
|
||||
}
|
||||
|
||||
@DrawableRes
|
||||
public int getIcon()
|
||||
{
|
||||
return mIconId;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public PlacePageButtons.ButtonType getType()
|
||||
{
|
||||
return mButtonType;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import app.organicmaps.MwmApplication;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
|
||||
public class PlacePageButtonFactory
|
||||
{
|
||||
static PlacePageButton createButton(PlacePageButtons.ButtonType buttonType, @NonNull Context context)
|
||||
{
|
||||
@StringRes int titleId = 0;
|
||||
@DrawableRes int iconId = 0;
|
||||
switch (buttonType)
|
||||
{
|
||||
case BACK:
|
||||
titleId = R.string.back;
|
||||
iconId = ThemeUtils.getResource(MwmApplication.from(context), android.R.attr.homeAsUpIndicator);
|
||||
break;
|
||||
case BOOKMARK_SAVE:
|
||||
titleId = R.string.save;
|
||||
iconId = R.drawable.ic_bookmarks_off;
|
||||
break;
|
||||
case BOOKMARK_DELETE:
|
||||
titleId = R.string.delete;
|
||||
iconId = R.drawable.ic_bookmarks_on;
|
||||
break;
|
||||
case ROUTE_FROM:
|
||||
titleId = R.string.p2p_from_here;
|
||||
iconId = R.drawable.ic_route_from;
|
||||
break;
|
||||
case ROUTE_TO:
|
||||
titleId = R.string.p2p_to_here;
|
||||
iconId = R.drawable.ic_route_to;
|
||||
break;
|
||||
case ROUTE_ADD:
|
||||
titleId = R.string.placepage_add_stop;
|
||||
iconId = R.drawable.ic_route_via;
|
||||
break;
|
||||
case ROUTE_REMOVE:
|
||||
titleId = R.string.placepage_remove_stop;
|
||||
iconId = R.drawable.ic_route_remove;
|
||||
break;
|
||||
case ROUTE_AVOID_TOLL:
|
||||
titleId = R.string.avoid_toll_roads_placepage;
|
||||
iconId = R.drawable.ic_avoid_tolls;
|
||||
break;
|
||||
case ROUTE_AVOID_UNPAVED:
|
||||
titleId = R.string.avoid_unpaved_roads_placepage;
|
||||
iconId = R.drawable.ic_avoid_unpaved;
|
||||
break;
|
||||
case ROUTE_AVOID_FERRY:
|
||||
titleId = R.string.avoid_ferry_crossing_placepage;
|
||||
iconId = R.drawable.ic_avoid_ferry;
|
||||
break;
|
||||
case SHARE:
|
||||
titleId = R.string.share;
|
||||
iconId = R.drawable.ic_share;
|
||||
break;
|
||||
case MORE:
|
||||
titleId = R.string.placepage_more_button;
|
||||
iconId = R.drawable.ic_more;
|
||||
break;
|
||||
}
|
||||
return new PlacePageButton(titleId, iconId, buttonType);
|
||||
}
|
||||
}
|
|
@ -1,109 +1,144 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.AttrRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import app.organicmaps.MwmApplication;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.routing.RoutingController;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetFragment;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public final class PlacePageButtons
|
||||
public final class PlacePageButtons extends Fragment implements Observer<List<PlacePageButtons.ButtonType>>
|
||||
{
|
||||
public static final String PLACEPAGE_MORE_MENU_ID = "PLACEPAGE_MORE_MENU_BOTTOM_SHEET";
|
||||
private final int mMaxButtons;
|
||||
private int mMaxButtons;
|
||||
|
||||
private final PlacePageView mPlacePage;
|
||||
private final ViewGroup mFrame;
|
||||
private final ItemListener mItemListener;
|
||||
private PlacePageButtonClickListener mItemListener;
|
||||
private ViewGroup mButtonsContainer;
|
||||
private PlacePageViewModel viewModel;
|
||||
|
||||
private List<PlacePageButton> mPrevItems;
|
||||
private List<PlacePageButton> mMoreItems;
|
||||
|
||||
interface PlacePageButton
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
@StringRes
|
||||
int getTitle();
|
||||
return inflater.inflate(R.layout.pp_buttons_fragment, container, false);
|
||||
}
|
||||
|
||||
ImageResources getIcon();
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mButtonsContainer = view.findViewById(R.id.container);
|
||||
view.setOnApplyWindowInsetsListener((v, windowInsets) -> {
|
||||
UiUtils.setViewInsetsPaddingNoTop(v, windowInsets);
|
||||
return windowInsets;
|
||||
});
|
||||
mMaxButtons = getResources().getInteger(R.integer.pp_buttons_max);
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(PlacePageViewModel.class);
|
||||
viewModel.getCurrentButtons().observe(requireActivity(), this);
|
||||
createButtons(viewModel.getCurrentButtons().getValue());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
ButtonType getType();
|
||||
|
||||
@DrawableRes
|
||||
int getBackgroundResource();
|
||||
|
||||
class ImageResources
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context)
|
||||
{
|
||||
super.onAttach(context);
|
||||
try
|
||||
{
|
||||
@DrawableRes
|
||||
private final int mEnabledStateResId;
|
||||
@DrawableRes
|
||||
private final int mDisabledStateResId;
|
||||
|
||||
public ImageResources(@DrawableRes int enabledStateResId, @DrawableRes int disabledStateResId)
|
||||
{
|
||||
mEnabledStateResId = enabledStateResId;
|
||||
mDisabledStateResId = disabledStateResId;
|
||||
}
|
||||
|
||||
public ImageResources(@DrawableRes int enabledStateResId)
|
||||
{
|
||||
this(enabledStateResId, enabledStateResId);
|
||||
}
|
||||
|
||||
@DrawableRes
|
||||
public int getDisabledStateResId()
|
||||
{
|
||||
return mDisabledStateResId;
|
||||
}
|
||||
|
||||
@DrawableRes
|
||||
public int getEnabledStateResId(@NonNull Context context)
|
||||
{
|
||||
return mEnabledStateResId;
|
||||
}
|
||||
|
||||
public static class Stub extends ImageResources
|
||||
{
|
||||
public Stub()
|
||||
{
|
||||
super(UiUtils.NO_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledStateResId()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported here");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnabledStateResId(@NonNull Context context)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported here");
|
||||
}
|
||||
}
|
||||
mItemListener = (PlacePageButtonClickListener) context;
|
||||
}
|
||||
catch (ClassCastException e)
|
||||
{
|
||||
throw new ClassCastException(context + " must implement PlacePageButtonClickListener");
|
||||
}
|
||||
}
|
||||
|
||||
enum ButtonType {
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
super.onDestroy();
|
||||
viewModel.getCurrentButtons().removeObserver(this);
|
||||
}
|
||||
|
||||
private @NonNull
|
||||
List<PlacePageButton> collectButtons(List<PlacePageButtons.ButtonType> items)
|
||||
{
|
||||
List<PlacePageButton> res = new ArrayList<>();
|
||||
int count = items.size();
|
||||
if (items.size() > mMaxButtons)
|
||||
count = mMaxButtons - 1;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
res.add(PlacePageButtonFactory.createButton(items.get(i), requireContext()));
|
||||
|
||||
if (items.size() > mMaxButtons)
|
||||
res.add(PlacePageButtonFactory.createButton(ButtonType.MORE, requireContext()));
|
||||
return res;
|
||||
}
|
||||
|
||||
private void showMoreBottomSheet()
|
||||
{
|
||||
MenuBottomSheetFragment.newInstance(PLACEPAGE_MORE_MENU_ID)
|
||||
.show(requireActivity().getSupportFragmentManager(), PLACEPAGE_MORE_MENU_ID);
|
||||
}
|
||||
|
||||
private void createButtons(@Nullable List<ButtonType> buttons)
|
||||
{
|
||||
if (buttons == null)
|
||||
return;
|
||||
List<PlacePageButton> shownButtons = collectButtons(buttons);
|
||||
mButtonsContainer.removeAllViews();
|
||||
for (PlacePageButton button : shownButtons)
|
||||
mButtonsContainer.addView(createButton(button));
|
||||
}
|
||||
|
||||
private View createButton(@NonNull final PlacePageButton current)
|
||||
{
|
||||
LayoutInflater inflater = LayoutInflater.from(requireContext());
|
||||
View parent = inflater.inflate(R.layout.place_page_button, mButtonsContainer, false);
|
||||
|
||||
ImageView icon = parent.findViewById(R.id.icon);
|
||||
TextView title = parent.findViewById(R.id.title);
|
||||
|
||||
title.setText(current.getTitle());
|
||||
@AttrRes final int tint = current.getType() == ButtonType.BOOKMARK_DELETE
|
||||
? R.attr.iconTintActive
|
||||
: R.attr.iconTint;
|
||||
icon.setImageDrawable(Graphics.tint(getContext(), current.getIcon(), tint));
|
||||
parent.setOnClickListener((view) -> {
|
||||
if (current.getType() == ButtonType.MORE)
|
||||
showMoreBottomSheet();
|
||||
else
|
||||
mItemListener.onPlacePageButtonClick(current.getType());
|
||||
});
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChanged(List<ButtonType> buttonTypes)
|
||||
{
|
||||
createButtons(buttonTypes);
|
||||
}
|
||||
|
||||
public enum ButtonType
|
||||
{
|
||||
BACK,
|
||||
BOOKMARK,
|
||||
BOOKMARK_SAVE,
|
||||
BOOKMARK_DELETE,
|
||||
ROUTE_FROM,
|
||||
ROUTE_TO,
|
||||
ROUTE_ADD,
|
||||
|
@ -112,276 +147,11 @@ public final class PlacePageButtons
|
|||
ROUTE_AVOID_FERRY,
|
||||
ROUTE_AVOID_UNPAVED,
|
||||
SHARE,
|
||||
MORE,
|
||||
CALL
|
||||
MORE
|
||||
}
|
||||
|
||||
enum Item implements PlacePageButtons.PlacePageButton
|
||||
public interface PlacePageButtonClickListener
|
||||
{
|
||||
BACK(
|
||||
R.string.back,
|
||||
new ImageResources.Stub()
|
||||
{
|
||||
@Override
|
||||
public int getEnabledStateResId(@NonNull Context context)
|
||||
{
|
||||
return ThemeUtils.getResource(MwmApplication.from(context),
|
||||
android.R.attr.homeAsUpIndicator);
|
||||
}
|
||||
},
|
||||
ButtonType.BACK),
|
||||
|
||||
BOOKMARK_SAVE(
|
||||
R.string.save,
|
||||
new ImageResources(R.drawable.ic_bookmarks_on),
|
||||
ButtonType.BOOKMARK),
|
||||
|
||||
BOOKMARK_DELETE(
|
||||
R.string.delete,
|
||||
new ImageResources(R.drawable.ic_bookmarks_off),
|
||||
ButtonType.BOOKMARK),
|
||||
|
||||
ROUTE_FROM(
|
||||
R.string.p2p_from_here,
|
||||
new ImageResources(R.drawable.ic_route_from),
|
||||
ButtonType.ROUTE_FROM),
|
||||
|
||||
ROUTE_TO(
|
||||
R.string.p2p_to_here,
|
||||
new ImageResources(R.drawable.ic_route_to),
|
||||
ButtonType.ROUTE_TO),
|
||||
|
||||
ROUTE_ADD(
|
||||
R.string.placepage_add_stop,
|
||||
new ImageResources(R.drawable.ic_route_via),
|
||||
ButtonType.ROUTE_ADD),
|
||||
|
||||
ROUTE_REMOVE(
|
||||
R.string.placepage_remove_stop,
|
||||
new ImageResources(R.drawable.ic_route_remove),
|
||||
ButtonType.ROUTE_REMOVE),
|
||||
|
||||
ROUTE_AVOID_TOLL(
|
||||
R.string.avoid_toll_roads_placepage,
|
||||
new ImageResources(R.drawable.ic_avoid_tolls),
|
||||
ButtonType.ROUTE_AVOID_TOLL),
|
||||
|
||||
ROUTE_AVOID_UNPAVED(
|
||||
R.string.avoid_unpaved_roads_placepage,
|
||||
new ImageResources(R.drawable.ic_avoid_unpaved),
|
||||
ButtonType.ROUTE_AVOID_UNPAVED),
|
||||
|
||||
ROUTE_AVOID_FERRY(
|
||||
R.string.avoid_ferry_crossing_placepage,
|
||||
new ImageResources(R.drawable.ic_avoid_ferry),
|
||||
ButtonType.ROUTE_AVOID_FERRY),
|
||||
|
||||
SHARE(
|
||||
R.string.share,
|
||||
new ImageResources(R.drawable.ic_share),
|
||||
ButtonType.SHARE),
|
||||
|
||||
// Must not be used outside
|
||||
MORE(
|
||||
R.string.placepage_more_button,
|
||||
new ImageResources(R.drawable.ic_more),
|
||||
ButtonType.MORE),
|
||||
|
||||
CALL(
|
||||
R.string.placepage_call_button,
|
||||
new ImageResources(R.drawable.ic_place_page_phone),
|
||||
ButtonType.CALL);
|
||||
|
||||
@StringRes
|
||||
private final int mTitleId;
|
||||
|
||||
@NonNull
|
||||
private final ImageResources mIconId;
|
||||
|
||||
@NonNull
|
||||
private final ButtonType mButtonType;
|
||||
|
||||
Item(@StringRes int titleId, @NonNull ImageResources iconId, @NonNull ButtonType buttonType)
|
||||
{
|
||||
mTitleId = titleId;
|
||||
mIconId = iconId;
|
||||
mButtonType = buttonType;
|
||||
}
|
||||
|
||||
@StringRes
|
||||
@Override
|
||||
public int getTitle()
|
||||
{
|
||||
return mTitleId;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ImageResources getIcon()
|
||||
{
|
||||
return mIconId;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ButtonType getType()
|
||||
{
|
||||
return mButtonType;
|
||||
}
|
||||
|
||||
@DrawableRes
|
||||
@Override
|
||||
public int getBackgroundResource()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported!");
|
||||
}
|
||||
}
|
||||
|
||||
interface ItemListener
|
||||
{
|
||||
void onPrepareVisibleView(@NonNull PlacePageButton item, @NonNull View frame,
|
||||
@NonNull ImageView icon, @NonNull TextView title);
|
||||
void onItemClick(PlacePageButton item);
|
||||
}
|
||||
|
||||
PlacePageButtons(PlacePageView placePage, ViewGroup frame, ItemListener itemListener)
|
||||
{
|
||||
mPlacePage = placePage;
|
||||
mFrame = frame;
|
||||
mItemListener = itemListener;
|
||||
|
||||
mMaxButtons = mPlacePage.getContext().getResources().getInteger(R.integer.pp_buttons_max);
|
||||
}
|
||||
|
||||
private @NonNull List<PlacePageButtons.PlacePageButton> collectButtons(List<PlacePageButtons.PlacePageButton> items)
|
||||
{
|
||||
List<PlacePageButtons.PlacePageButton> res = new ArrayList<>(items);
|
||||
if (res.size() > mMaxButtons)
|
||||
res.add(mMaxButtons - 1, Item.MORE);
|
||||
|
||||
// Swap ROUTE_FROM and ROUTE_TO if the latter one was pressed out to bottomsheet
|
||||
int from = res.indexOf(Item.ROUTE_FROM);
|
||||
if (from > -1)
|
||||
{
|
||||
int addStop = res.indexOf(Item.ROUTE_ADD);
|
||||
int to = res.indexOf(Item.ROUTE_TO);
|
||||
if ((to > from && to >= mMaxButtons) || (to > from && addStop >= mMaxButtons))
|
||||
Collections.swap(res, from, to);
|
||||
|
||||
if (addStop >= mMaxButtons)
|
||||
{
|
||||
from = res.indexOf(Item.ROUTE_FROM);
|
||||
if (addStop > from)
|
||||
Collections.swap(res, from, addStop);
|
||||
}
|
||||
|
||||
preserveRoutingButtons(res, Item.CALL);
|
||||
from = res.indexOf(Item.ROUTE_FROM);
|
||||
to = res.indexOf(Item.ROUTE_TO);
|
||||
if (from < mMaxButtons && from > to)
|
||||
Collections.swap(res, to, from);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
private void preserveRoutingButtons(@NonNull List<PlacePageButton> items, @NonNull Item itemToShift)
|
||||
{
|
||||
if (!RoutingController.get().isNavigating() && !RoutingController.get().isPlanning())
|
||||
return;
|
||||
|
||||
int pos = items.indexOf(itemToShift);
|
||||
if (pos > -1)
|
||||
{
|
||||
items.remove(pos);
|
||||
items.add(mMaxButtons, itemToShift);
|
||||
int to = items.indexOf(Item.ROUTE_TO);
|
||||
if (items.indexOf(Item.ROUTE_ADD) > -1)
|
||||
{
|
||||
items.remove(Item.ROUTE_ADD);
|
||||
items.remove(Item.ROUTE_FROM);
|
||||
items.add(to + 1, Item.ROUTE_ADD);
|
||||
items.add(mMaxButtons, Item.ROUTE_FROM);
|
||||
}
|
||||
else
|
||||
{
|
||||
items.remove(Item.ROUTE_FROM);
|
||||
items.add(to + 1, Item.ROUTE_FROM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ArrayList<MenuBottomSheetItem> getMenuBottomSheetItems()
|
||||
{
|
||||
if (mMoreItems == null)
|
||||
return null;
|
||||
ArrayList<MenuBottomSheetItem> items = new ArrayList<>();
|
||||
for (int i = mMaxButtons; i < mMoreItems.size(); i++)
|
||||
{
|
||||
final PlacePageButton bsItem = mMoreItems.get(i);
|
||||
int iconRes = bsItem.getIcon().getEnabledStateResId(mPlacePage.getContext());
|
||||
items.add(new MenuBottomSheetItem(bsItem.getTitle(), iconRes, () -> mItemListener.onItemClick(bsItem)));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
private void showPopup()
|
||||
{
|
||||
MenuBottomSheetFragment.newInstance(PLACEPAGE_MORE_MENU_ID)
|
||||
.show(mPlacePage.requireActivity().getSupportFragmentManager(), PLACEPAGE_MORE_MENU_ID);
|
||||
}
|
||||
|
||||
private View createButton(@NonNull final List<PlacePageButton> items,
|
||||
@NonNull final PlacePageButton current)
|
||||
{
|
||||
Context context = mPlacePage.getContext();
|
||||
LayoutInflater inflater = LayoutInflater.from(context);
|
||||
View parent = inflater.inflate(R.layout.place_page_button, mFrame, false);
|
||||
|
||||
ImageView icon = parent.findViewById(R.id.icon);
|
||||
TextView title = parent.findViewById(R.id.title);
|
||||
|
||||
title.setText(current.getTitle());
|
||||
icon.setImageResource(current.getIcon().getEnabledStateResId(context));
|
||||
mItemListener.onPrepareVisibleView(current, parent, icon, title);
|
||||
if (current == Item.MORE)
|
||||
mMoreItems = items;
|
||||
parent.setOnClickListener(new ShowPopupClickListener(current));
|
||||
return parent;
|
||||
}
|
||||
|
||||
void setItems(List<PlacePageButton> items)
|
||||
{
|
||||
final List<PlacePageButton> buttons = collectButtons(items);
|
||||
if (buttons.equals(mPrevItems))
|
||||
return;
|
||||
|
||||
mFrame.removeAllViews();
|
||||
int count = Math.min(buttons.size(), mMaxButtons);
|
||||
for (int i = 0; i < count; i++)
|
||||
mFrame.addView(createButton(buttons, buttons.get(i)));
|
||||
|
||||
mPrevItems = buttons;
|
||||
}
|
||||
|
||||
private class ShowPopupClickListener implements View.OnClickListener
|
||||
{
|
||||
@NonNull
|
||||
private final PlacePageButton mCurrent;
|
||||
|
||||
public ShowPopupClickListener(@NonNull PlacePageButton current)
|
||||
{
|
||||
mCurrent = current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
if (mCurrent == Item.MORE)
|
||||
showPopup();
|
||||
else
|
||||
mItemListener.onItemClick(mCurrent);
|
||||
}
|
||||
void onPlacePageButtonClick(ButtonType item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +1,499 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowInsets;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.NestedScrollViewClickFixed;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import app.organicmaps.Framework;
|
||||
import app.organicmaps.MwmActivity;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.api.ParsedMwmRequest;
|
||||
import app.organicmaps.base.Initializable;
|
||||
import app.organicmaps.base.Savable;
|
||||
import app.organicmaps.base.Supportable;
|
||||
import app.organicmaps.bookmarks.data.MapObject;
|
||||
import app.organicmaps.bookmarks.data.RoadWarningMarkType;
|
||||
import app.organicmaps.routing.RoutingController;
|
||||
import app.organicmaps.settings.RoadType;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetFragment;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetItem;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public interface PlacePageController extends Initializable<Activity>,
|
||||
Savable<Bundle>,
|
||||
Application.ActivityLifecycleCallbacks,
|
||||
Supportable<PlacePageData>
|
||||
public class PlacePageController implements Initializable<Activity>,
|
||||
Savable<Bundle>,
|
||||
PlacePageView.PlacePageViewListener,
|
||||
PlacePageButtons.PlacePageButtonClickListener,
|
||||
MenuBottomSheetFragment.MenuBottomSheetInterface,
|
||||
Observer<MapObject>
|
||||
{
|
||||
void openFor(@NonNull PlacePageData data);
|
||||
void close(boolean deactivateMapSelection);
|
||||
boolean isClosed();
|
||||
int getPlacePageWidth();
|
||||
@Nullable
|
||||
ArrayList<MenuBottomSheetItem> getMenuBottomSheetItems();
|
||||
private static final String TAG = PlacePageController.class.getSimpleName();
|
||||
private static final String PLACE_PAGE_BUTTONS_FRAGMENT_TAG = "PLACE_PAGE_BUTTONS";
|
||||
private static final String PLACE_PAGE_FRAGMENT_TAG = "PLACE_PAGE";
|
||||
|
||||
interface SlideListener
|
||||
private static final float PREVIEW_PLUS_RATIO = 0.45f;
|
||||
@NonNull
|
||||
private final SlideListener mSlideListener;
|
||||
@NonNull
|
||||
private final BottomSheetBehavior<View> mPlacePageBehavior;
|
||||
@NonNull
|
||||
private final NestedScrollViewClickFixed mPlacePage;
|
||||
@NonNull
|
||||
private final ViewGroup mPlacePageContainer;
|
||||
private final ViewGroup mCoordinator;
|
||||
private final int mViewportMinHeight;
|
||||
private final AppCompatActivity mMwmActivity;
|
||||
private final int mButtonsHeight;
|
||||
private final int mMaxButtons;
|
||||
private final PlacePageViewModel viewModel;
|
||||
private int mPreviewHeight;
|
||||
private int mFrameHeight;
|
||||
private boolean mDeactivateMapSelection = true;
|
||||
@Nullable
|
||||
private MapObject mMapObject;
|
||||
private WindowInsets mCurrentWindowInsets;
|
||||
|
||||
private boolean mShouldCollapse;
|
||||
private int mDistanceToTop;
|
||||
|
||||
private ValueAnimator mCustomPeekHeightAnimator;
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
public PlacePageController(@Nullable Activity activity,
|
||||
@NonNull SlideListener listener)
|
||||
{
|
||||
mSlideListener = listener;
|
||||
|
||||
Objects.requireNonNull(activity);
|
||||
mMwmActivity = (AppCompatActivity) activity;
|
||||
mCoordinator = mMwmActivity.findViewById(R.id.coordinator);
|
||||
Resources res = activity.getResources();
|
||||
mViewportMinHeight = res.getDimensionPixelSize(R.dimen.viewport_min_height);
|
||||
mPlacePage = activity.findViewById(R.id.placepage);
|
||||
mPlacePageContainer = activity.findViewById(R.id.placepage_container);
|
||||
mPlacePageBehavior = BottomSheetBehavior.from(mPlacePage);
|
||||
|
||||
mShouldCollapse = true;
|
||||
|
||||
BottomSheetChangedListener bottomSheetChangedListener = new BottomSheetChangedListener()
|
||||
{
|
||||
@Override
|
||||
public void onSheetHidden()
|
||||
{
|
||||
onHiddenInternal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetDetailsOpened()
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetCollapsed()
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetSliding(int top)
|
||||
{
|
||||
stopCustomPeekHeightAnimation();
|
||||
mDistanceToTop = top;
|
||||
mSlideListener.onPlacePageSlide(top);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetSlideFinish()
|
||||
{
|
||||
PlacePageUtils.moveViewportUp(mPlacePage, mViewportMinHeight);
|
||||
}
|
||||
};
|
||||
BottomSheetBehavior.BottomSheetCallback sheetCallback = new DefaultBottomSheetCallback(bottomSheetChangedListener);
|
||||
mPlacePageBehavior.addBottomSheetCallback(sheetCallback);
|
||||
mPlacePageBehavior.setHideable(true);
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
mPlacePageBehavior.setFitToContents(true);
|
||||
mPlacePageBehavior.setSkipCollapsed(true);
|
||||
|
||||
UiUtils.bringViewToFrontOf(activity.findViewById(R.id.pp_buttons_fragment), mPlacePage);
|
||||
|
||||
mPlacePage.requestApplyInsets();
|
||||
|
||||
mButtonsHeight = (int) mMwmActivity.getResources()
|
||||
.getDimension(R.dimen.place_page_buttons_height);
|
||||
mMaxButtons = mMwmActivity.getResources().getInteger(R.integer.pp_buttons_max);
|
||||
viewModel = new ViewModelProvider(mMwmActivity).get(PlacePageViewModel.class);
|
||||
|
||||
mPlacePage.setOnApplyWindowInsetsListener((view, windowInsets) -> {
|
||||
mCurrentWindowInsets = windowInsets;
|
||||
return windowInsets;
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static PlacePageButtons.ButtonType toPlacePageButton(@NonNull RoadWarningMarkType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DIRTY:
|
||||
return PlacePageButtons.ButtonType.ROUTE_AVOID_UNPAVED;
|
||||
case FERRY:
|
||||
return PlacePageButtons.ButtonType.ROUTE_AVOID_FERRY;
|
||||
case TOLL:
|
||||
return PlacePageButtons.ButtonType.ROUTE_AVOID_TOLL;
|
||||
default:
|
||||
throw new AssertionError("Unsupported road warning type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
private void stopCustomPeekHeightAnimation()
|
||||
{
|
||||
if (mCustomPeekHeightAnimator != null && mCustomPeekHeightAnimator.isStarted())
|
||||
{
|
||||
mCustomPeekHeightAnimator.end();
|
||||
setPlacePageHeightBounds();
|
||||
}
|
||||
}
|
||||
|
||||
private void onHiddenInternal()
|
||||
{
|
||||
if (mDeactivateMapSelection)
|
||||
Framework.nativeDeactivatePopup();
|
||||
mDeactivateMapSelection = true;
|
||||
PlacePageUtils.moveViewportUp(mPlacePage, mViewportMinHeight);
|
||||
resetPlacePageHeightBounds();
|
||||
removePlacePageFragments();
|
||||
}
|
||||
|
||||
public int getPlacePageWidth()
|
||||
{
|
||||
return mPlacePage.getWidth();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ArrayList<MenuBottomSheetItem> getMenuBottomSheetItems(String id)
|
||||
{
|
||||
final List<PlacePageButtons.ButtonType> currentItems = viewModel.getCurrentButtons().getValue();
|
||||
if (currentItems == null || currentItems.size() <= mMaxButtons)
|
||||
return null;
|
||||
ArrayList<MenuBottomSheetItem> items = new ArrayList<>();
|
||||
for (int i = mMaxButtons - 1; i < currentItems.size(); i++)
|
||||
{
|
||||
final PlacePageButton bsItem = PlacePageButtonFactory.createButton(currentItems.get(i), mMwmActivity);
|
||||
items.add(new MenuBottomSheetItem(
|
||||
bsItem.getTitle(),
|
||||
bsItem.getIcon(),
|
||||
() -> ((PlacePageButtons.PlacePageButtonClickListener) mMwmActivity).onPlacePageButtonClick(bsItem.getType())
|
||||
));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
public void openFor(@NonNull PlacePageData data)
|
||||
{
|
||||
mDeactivateMapSelection = true;
|
||||
MapObject mapObject = (MapObject) data;
|
||||
final MapObject previousMapObject = viewModel.getMapObject().getValue();
|
||||
// Only collapse the place page if the data is different from the one already available
|
||||
mShouldCollapse = PlacePageUtils.isHiddenState(mPlacePageBehavior.getState()) || !MapObject.same(previousMapObject, mapObject);
|
||||
viewModel.setMapObject(mapObject);
|
||||
}
|
||||
|
||||
private void resetPlacePageHeightBounds()
|
||||
{
|
||||
mFrameHeight = 0;
|
||||
mPlacePageContainer.setMinimumHeight(0);
|
||||
final int parentHeight = ((View) mPlacePage.getParent()).getHeight();
|
||||
mPlacePageBehavior.setMaxHeight(parentHeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the min and max height of the place page to prevent jumps when switching from one map object
|
||||
* to the other.
|
||||
*/
|
||||
private void setPlacePageHeightBounds()
|
||||
{
|
||||
final int peekHeight = calculatePeekHeight();
|
||||
// Make sure the place page can reach the peek height
|
||||
final int height = Math.max(peekHeight, mFrameHeight);
|
||||
// Set the minimum height of the place page to prevent jumps when new data results in SMALLER content
|
||||
// This cannot be set on the place page itself as it has the fitToContent property set
|
||||
mPlacePageContainer.setMinimumHeight(height);
|
||||
// Set the maximum height of the place page to prevent jumps when new data results in BIGGER content
|
||||
// It does not take into account the navigation bar height so we need to add it manually
|
||||
mPlacePageBehavior.setMaxHeight(height + mCurrentWindowInsets.getSystemWindowInsetBottom());
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure the place page can reach the peek height
|
||||
*/
|
||||
private void preparePlacePageMinHeight(int peekHeight)
|
||||
{
|
||||
final int currentHeight = mPlacePageContainer.getHeight();
|
||||
if (currentHeight < peekHeight)
|
||||
mPlacePageContainer.setMinimumHeight(peekHeight);
|
||||
}
|
||||
|
||||
private void setPeekHeight()
|
||||
{
|
||||
final int peekHeight = calculatePeekHeight();
|
||||
preparePlacePageMinHeight(peekHeight);
|
||||
|
||||
final int state = mPlacePageBehavior.getState();
|
||||
// Do not animate the peek height if the place page should not be collapsed (eg: when returning from editor)
|
||||
final boolean shouldAnimate = !(PlacePageUtils.isExpandedState(state) && !mShouldCollapse) && !PlacePageUtils.isHiddenState(state);
|
||||
if (shouldAnimate)
|
||||
animatePeekHeight(peekHeight);
|
||||
else
|
||||
{
|
||||
mPlacePageBehavior.setPeekHeight(peekHeight);
|
||||
setPlacePageHeightBounds();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Using the animate param in setPeekHeight does not work when adding removing fragments
|
||||
* from inside the place page so we manually animate the peek height with ValueAnimator
|
||||
*/
|
||||
private void animatePeekHeight(int peekHeight)
|
||||
{
|
||||
// Make sure to start from the current height of the place page
|
||||
final int parentHeight = ((View) mPlacePage.getParent()).getHeight();
|
||||
// Make sure to remove the navbar height because the peek height already takes it into account
|
||||
int initialHeight = parentHeight - mDistanceToTop - mCurrentWindowInsets.getSystemWindowInsetBottom();
|
||||
|
||||
if (mCustomPeekHeightAnimator != null)
|
||||
mCustomPeekHeightAnimator.cancel();
|
||||
mCustomPeekHeightAnimator = ValueAnimator.ofInt(initialHeight, peekHeight);
|
||||
mCustomPeekHeightAnimator.setInterpolator(new FastOutSlowInInterpolator());
|
||||
mCustomPeekHeightAnimator.addUpdateListener(valueAnimator -> {
|
||||
int value = (Integer) valueAnimator.getAnimatedValue();
|
||||
// Make sure the place page can reach the animated peek height to prevent jumps
|
||||
// maxHeight does not take the navbar height into account so we manually add it
|
||||
mPlacePageBehavior.setMaxHeight(value + mCurrentWindowInsets.getSystemWindowInsetBottom());
|
||||
mPlacePageBehavior.setPeekHeight(value);
|
||||
// The place page is not firing the slide callbacks when using this animation, so we must call them manually
|
||||
mDistanceToTop = parentHeight - value - mCurrentWindowInsets.getSystemWindowInsetBottom();
|
||||
mSlideListener.onPlacePageSlide(mDistanceToTop);
|
||||
if (value == peekHeight)
|
||||
{
|
||||
PlacePageUtils.moveViewportUp(mPlacePage, mViewportMinHeight);
|
||||
setPlacePageHeightBounds();
|
||||
}
|
||||
});
|
||||
mCustomPeekHeightAnimator.setDuration(200);
|
||||
mCustomPeekHeightAnimator.start();
|
||||
}
|
||||
|
||||
private int calculatePeekHeight()
|
||||
{
|
||||
if (mMapObject != null && mMapObject.getOpeningMode() == MapObject.OPENING_MODE_PREVIEW_PLUS)
|
||||
return (int) (mCoordinator.getHeight() * PREVIEW_PLUS_RATIO);
|
||||
return mPreviewHeight + mButtonsHeight;
|
||||
}
|
||||
|
||||
public void close(boolean deactivateMapSelection)
|
||||
{
|
||||
mDeactivateMapSelection = deactivateMapSelection;
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
}
|
||||
|
||||
public boolean isClosed()
|
||||
{
|
||||
return PlacePageUtils.isHiddenState(mPlacePageBehavior.getState());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSave(@NonNull Bundle outState)
|
||||
{
|
||||
// no op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestore(@NonNull Bundle inState)
|
||||
{
|
||||
if (mPlacePageBehavior.getState() == BottomSheetBehavior.STATE_HIDDEN)
|
||||
return;
|
||||
if (!Framework.nativeHasPlacePageInfo())
|
||||
close(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageContentChanged(int previewHeight, int frameHeight)
|
||||
{
|
||||
mPreviewHeight = previewHeight;
|
||||
mFrameHeight = frameHeight;
|
||||
// Make sure to update the peek height on the UI thread to prevent weird animation jumps
|
||||
mPlacePage.post(() -> {
|
||||
setPeekHeight();
|
||||
if (mShouldCollapse && !PlacePageUtils.isCollapsedState(mPlacePageBehavior.getState()))
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
mShouldCollapse = false;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageRequestClose()
|
||||
{
|
||||
close(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageRequestToggleState()
|
||||
{
|
||||
@BottomSheetBehavior.State
|
||||
int state = mPlacePageBehavior.getState();
|
||||
stopCustomPeekHeightAnimation();
|
||||
if (PlacePageUtils.isExpandedState(state))
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
else
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageRequestToggleRouteSettings(@NonNull RoadType roadType)
|
||||
{
|
||||
// no op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacePageButtonClick(PlacePageButtons.ButtonType item)
|
||||
{
|
||||
@Nullable final PlacePageView placePageFragment = (PlacePageView) mMwmActivity.getSupportFragmentManager()
|
||||
.findFragmentByTag(PLACE_PAGE_FRAGMENT_TAG);
|
||||
if (placePageFragment != null)
|
||||
placePageFragment.onPlacePageButtonClick(item);
|
||||
}
|
||||
|
||||
private void removePlacePageFragments()
|
||||
{
|
||||
final FragmentManager fm = mMwmActivity.getSupportFragmentManager();
|
||||
final Fragment placePageButtonsFragment = fm.findFragmentByTag(PLACE_PAGE_BUTTONS_FRAGMENT_TAG);
|
||||
final Fragment placePageFragment = fm.findFragmentByTag(PLACE_PAGE_FRAGMENT_TAG);
|
||||
|
||||
if (placePageButtonsFragment != null)
|
||||
{
|
||||
fm.beginTransaction()
|
||||
.setReorderingAllowed(true)
|
||||
.remove(placePageButtonsFragment)
|
||||
.commitNow();
|
||||
}
|
||||
if (placePageFragment != null)
|
||||
{
|
||||
// Make sure to synchronously remove the fragment so setting the map object to null
|
||||
// won't impact the fragment
|
||||
fm.beginTransaction()
|
||||
.setReorderingAllowed(true)
|
||||
.remove(placePageFragment)
|
||||
.commitNow();
|
||||
}
|
||||
viewModel.setMapObject(null);
|
||||
}
|
||||
|
||||
private void createPlacePageFragments()
|
||||
{
|
||||
final FragmentManager fm = mMwmActivity.getSupportFragmentManager();
|
||||
if (fm.findFragmentByTag(PLACE_PAGE_FRAGMENT_TAG) == null)
|
||||
{
|
||||
fm.beginTransaction()
|
||||
.setReorderingAllowed(true)
|
||||
.add(R.id.placepage_fragment, PlacePageView.class, null, PLACE_PAGE_FRAGMENT_TAG)
|
||||
.commit();
|
||||
}
|
||||
if (fm.findFragmentByTag(PLACE_PAGE_BUTTONS_FRAGMENT_TAG) == null)
|
||||
{
|
||||
fm.beginTransaction()
|
||||
.setReorderingAllowed(true)
|
||||
.add(R.id.pp_buttons_fragment, PlacePageButtons.class, null, PLACE_PAGE_BUTTONS_FRAGMENT_TAG)
|
||||
.commit();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateButtons(MapObject mapObject, boolean showBackButton, boolean showRoutingButton)
|
||||
{
|
||||
List<PlacePageButtons.ButtonType> buttons = new ArrayList<>();
|
||||
if (mapObject.getRoadWarningMarkType() != RoadWarningMarkType.UNKNOWN)
|
||||
{
|
||||
RoadWarningMarkType markType = mapObject.getRoadWarningMarkType();
|
||||
PlacePageButtons.ButtonType roadType = toPlacePageButton(markType);
|
||||
buttons.add(roadType);
|
||||
}
|
||||
else if (RoutingController.get().isRoutePoint(mapObject))
|
||||
{
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_REMOVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
final ParsedMwmRequest request = ParsedMwmRequest.getCurrentRequest();
|
||||
if (showBackButton || (request != null && request.isPickPointMode()))
|
||||
buttons.add(PlacePageButtons.ButtonType.BACK);
|
||||
|
||||
boolean needToShowRoutingButtons = RoutingController.get().isPlanning() || showRoutingButton;
|
||||
|
||||
if (needToShowRoutingButtons)
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_FROM);
|
||||
|
||||
buttons.add(mapObject.getMapObjectType() == MapObject.BOOKMARK
|
||||
? PlacePageButtons.ButtonType.BOOKMARK_DELETE
|
||||
: PlacePageButtons.ButtonType.BOOKMARK_SAVE);
|
||||
|
||||
if (needToShowRoutingButtons)
|
||||
{
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_TO);
|
||||
if (RoutingController.get().isStopPointAllowed())
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_ADD);
|
||||
}
|
||||
buttons.add(PlacePageButtons.ButtonType.SHARE);
|
||||
}
|
||||
viewModel.setCurrentButtons(buttons);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChanged(@Nullable MapObject mapObject)
|
||||
{
|
||||
mMapObject = mapObject;
|
||||
if (mapObject != null)
|
||||
{
|
||||
createPlacePageFragments();
|
||||
updateButtons(
|
||||
mapObject,
|
||||
MapObject.isOfType(MapObject.API_POINT, mMapObject),
|
||||
!MapObject.isOfType(MapObject.MY_POSITION, mMapObject));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(@Nullable Activity activity)
|
||||
{
|
||||
Objects.requireNonNull(activity);
|
||||
viewModel.getMapObject().observe((MwmActivity) activity, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
viewModel.getMapObject().removeObserver(this);
|
||||
}
|
||||
|
||||
public interface SlideListener
|
||||
{
|
||||
void onPlacePageSlide(int top);
|
||||
}
|
||||
|
|
|
@ -1,187 +0,0 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetItem;
|
||||
import app.organicmaps.util.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class PlacePageControllerComposite implements PlacePageController
|
||||
{
|
||||
@NonNull
|
||||
private final PlacePageController.SlideListener mSlideListener;
|
||||
@Nullable
|
||||
private final RoutingModeListener mRoutingModeListener;
|
||||
@NonNull
|
||||
private final List<PlacePageController> mControllers = new ArrayList<>();
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private PlacePageController mActiveController;
|
||||
|
||||
PlacePageControllerComposite(@NonNull SlideListener slideListener,
|
||||
@Nullable RoutingModeListener routingModeListener)
|
||||
{
|
||||
mSlideListener = slideListener;
|
||||
mRoutingModeListener = routingModeListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacePageWidth()
|
||||
{
|
||||
return mActiveController.getPlacePageWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ArrayList<MenuBottomSheetItem> getMenuBottomSheetItems()
|
||||
{
|
||||
return mActiveController.getMenuBottomSheetItems();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openFor(@NonNull PlacePageData data)
|
||||
{
|
||||
boolean support = mActiveController.support(data);
|
||||
if (support)
|
||||
{
|
||||
mActiveController.openFor(data);
|
||||
return;
|
||||
}
|
||||
|
||||
mActiveController.close(false);
|
||||
PlacePageController controller = findControllerFor(data);
|
||||
if (controller == null)
|
||||
throw new UnsupportedOperationException("Place page data '" + data + "' not supported " +
|
||||
"by existing controllers");
|
||||
mActiveController = controller;
|
||||
mActiveController.openFor(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(boolean deactivateMapSelection)
|
||||
{
|
||||
mActiveController.close(deactivateMapSelection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed()
|
||||
{
|
||||
return mActiveController.isClosed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState)
|
||||
{
|
||||
mActiveController.onActivityCreated(activity, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity)
|
||||
{
|
||||
mActiveController.onActivityStarted(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity)
|
||||
{
|
||||
mActiveController.onActivityResumed(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity)
|
||||
{
|
||||
mActiveController.onActivityPaused(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity)
|
||||
{
|
||||
mActiveController.onActivityStopped(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState)
|
||||
{
|
||||
mActiveController.onActivitySaveInstanceState(activity, outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity)
|
||||
{
|
||||
mActiveController.onActivityDestroyed(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(@Nullable Activity activity)
|
||||
{
|
||||
if (!mControllers.isEmpty())
|
||||
throw new AssertionError("Place page controllers already initialized!");
|
||||
|
||||
PlacePageController richController =
|
||||
PlacePageFactory.createRichController(mSlideListener, mRoutingModeListener);
|
||||
richController.initialize(activity);
|
||||
mControllers.add(richController);
|
||||
|
||||
PlacePageController elevationProfileController =
|
||||
PlacePageFactory.createElevationProfilePlacePageController(mSlideListener);
|
||||
elevationProfileController.initialize(activity);
|
||||
mControllers.add(elevationProfileController);
|
||||
|
||||
mActiveController = richController;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
if (mControllers.isEmpty())
|
||||
throw new AssertionError("Place page controllers already destroyed!");
|
||||
|
||||
for (PlacePageController controller: mControllers)
|
||||
controller.destroy();
|
||||
|
||||
mControllers.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSave(@NonNull Bundle outState)
|
||||
{
|
||||
mActiveController.onSave(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestore(@NonNull Bundle inState)
|
||||
{
|
||||
PlacePageData data = Utils.getParcelable(inState, PlacePageUtils.EXTRA_PLACE_PAGE_DATA, PlacePageData.class);
|
||||
if (data != null)
|
||||
{
|
||||
PlacePageController controller = findControllerFor(data);
|
||||
if (controller != null)
|
||||
mActiveController = controller;
|
||||
}
|
||||
mActiveController.onRestore(inState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private PlacePageController findControllerFor(@NonNull PlacePageData object)
|
||||
{
|
||||
for (PlacePageController controller : mControllers)
|
||||
{
|
||||
if (controller.support(object))
|
||||
return controller;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean support(@NonNull PlacePageData object)
|
||||
{
|
||||
return mActiveController.support(object);
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import app.organicmaps.R;
|
||||
|
||||
public class PlacePageFactory
|
||||
{
|
||||
@NonNull
|
||||
public static PlacePageController createCompositePlacePageController(
|
||||
@NonNull PlacePageController.SlideListener slideListener,
|
||||
@NonNull RoutingModeListener routingModeListener)
|
||||
{
|
||||
return new PlacePageControllerComposite(slideListener, routingModeListener);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
static PlacePageController createRichController(
|
||||
@NonNull PlacePageController.SlideListener listener,
|
||||
@Nullable RoutingModeListener routingModeListener)
|
||||
{
|
||||
return new RichPlacePageController(listener, routingModeListener);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
static PlacePageController createElevationProfilePlacePageController(
|
||||
@NonNull PlacePageController.SlideListener listener)
|
||||
{
|
||||
ElevationProfileViewRenderer renderer = new ElevationProfileViewRenderer();
|
||||
return new SimplePlacePageController(R.id.elevation_profile, renderer, renderer, listener);
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.view.GestureDetector;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
|
||||
class PlacePageGestureListener extends GestureDetector.SimpleOnGestureListener
|
||||
{
|
||||
@NonNull
|
||||
private final BottomSheetBehavior<View> mBottomSheetBehavior;
|
||||
|
||||
PlacePageGestureListener(@NonNull BottomSheetBehavior<View> bottomSheetBehavior)
|
||||
{
|
||||
mBottomSheetBehavior = bottomSheetBehavior;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
BottomSheetBehavior<View> getBottomSheetBehavior()
|
||||
{
|
||||
return mBottomSheetBehavior;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSingleTapConfirmed(MotionEvent e)
|
||||
{
|
||||
@BottomSheetBehavior.State
|
||||
int state = mBottomSheetBehavior.getState();
|
||||
if (PlacePageUtils.isCollapsedState(state))
|
||||
{
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PlacePageUtils.isExpandedState(state))
|
||||
{
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,276 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.bookmarks.data.MapObject;
|
||||
import app.organicmaps.bookmarks.data.Metadata;
|
||||
import app.organicmaps.util.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
public class PlacePageLinksFragment extends Fragment implements Observer<MapObject>
|
||||
{
|
||||
static final List<Metadata.MetadataType> supportedLinks = Arrays.asList(
|
||||
Metadata.MetadataType.FMD_WEBSITE,
|
||||
Metadata.MetadataType.FMD_EMAIL,
|
||||
Metadata.MetadataType.FMD_WIKIMEDIA_COMMONS,
|
||||
Metadata.MetadataType.FMD_CONTACT_FACEBOOK,
|
||||
Metadata.MetadataType.FMD_CONTACT_INSTAGRAM,
|
||||
Metadata.MetadataType.FMD_CONTACT_TWITTER,
|
||||
Metadata.MetadataType.FMD_CONTACT_VK,
|
||||
Metadata.MetadataType.FMD_CONTACT_LINE);
|
||||
|
||||
private View mFrame;
|
||||
private View mFacebookPage;
|
||||
private TextView mTvFacebookPage;
|
||||
private View mInstagramPage;
|
||||
private TextView mTvInstagramPage;
|
||||
private View mTwitterPage;
|
||||
private TextView mTvTwitterPage;
|
||||
private View mVkPage;
|
||||
private TextView mTvVkPage;
|
||||
private View mLinePage;
|
||||
private TextView mTvLinePage;
|
||||
|
||||
private View mWebsite;
|
||||
private TextView mTvWebsite;
|
||||
private View mEmail;
|
||||
private TextView mTvEmail;
|
||||
private View mWikimedia;
|
||||
private TextView mTvWikimedia;
|
||||
|
||||
private PlacePageViewModel viewModel;
|
||||
private MapObject mMapObject;
|
||||
|
||||
private static void refreshMetadataOrHide(String metadata, View metaLayout, TextView metaTv)
|
||||
{
|
||||
if (!TextUtils.isEmpty(metadata))
|
||||
{
|
||||
metaLayout.setVisibility(VISIBLE);
|
||||
if (metaTv != null)
|
||||
metaTv.setText(metadata);
|
||||
}
|
||||
else
|
||||
metaLayout.setVisibility(GONE);
|
||||
}
|
||||
|
||||
public static boolean hasLinkAvailable(MapObject mapObject)
|
||||
{
|
||||
for (Metadata.MetadataType type: supportedLinks) {
|
||||
final String metadata = type == Metadata.MetadataType.FMD_WEBSITE ? getWebsiteUrl(mapObject) : mapObject.getMetadata(type);
|
||||
if (!TextUtils.isEmpty(metadata))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
return inflater.inflate(R.layout.place_page_links_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mFrame = view;
|
||||
|
||||
mWebsite = mFrame.findViewById(R.id.ll__place_website);
|
||||
mTvWebsite = mFrame.findViewById(R.id.tv__place_website);
|
||||
mWebsite.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_WEBSITE));
|
||||
mWebsite.setOnLongClickListener((v) -> copyUrl(mWebsite, Metadata.MetadataType.FMD_WEBSITE));
|
||||
|
||||
mEmail = mFrame.findViewById(R.id.ll__place_email);
|
||||
mTvEmail = mFrame.findViewById(R.id.tv__place_email);
|
||||
mEmail.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_EMAIL));
|
||||
mEmail.setOnLongClickListener((v) -> copyUrl(mEmail, Metadata.MetadataType.FMD_EMAIL));
|
||||
|
||||
mWikimedia = mFrame.findViewById(R.id.ll__place_wikimedia);
|
||||
mTvWikimedia = mFrame.findViewById(R.id.tv__place_wikimedia);
|
||||
mWikimedia.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_WIKIMEDIA_COMMONS));
|
||||
mWikimedia.setOnLongClickListener((v) -> copyUrl(mWikimedia, Metadata.MetadataType.FMD_WIKIMEDIA_COMMONS));
|
||||
|
||||
mFacebookPage = mFrame.findViewById(R.id.ll__place_facebook);
|
||||
mTvFacebookPage = mFrame.findViewById(R.id.tv__place_facebook_page);
|
||||
mFacebookPage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_FACEBOOK));
|
||||
mFacebookPage.setOnLongClickListener((v) -> copyUrl(mFacebookPage, Metadata.MetadataType.FMD_CONTACT_FACEBOOK));
|
||||
|
||||
mInstagramPage = mFrame.findViewById(R.id.ll__place_instagram);
|
||||
mTvInstagramPage = mFrame.findViewById(R.id.tv__place_instagram_page);
|
||||
mInstagramPage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_INSTAGRAM));
|
||||
mInstagramPage.setOnLongClickListener((v) -> copyUrl(mInstagramPage, Metadata.MetadataType.FMD_CONTACT_INSTAGRAM));
|
||||
|
||||
mTwitterPage = mFrame.findViewById(R.id.ll__place_twitter);
|
||||
mTvTwitterPage = mFrame.findViewById(R.id.tv__place_twitter_page);
|
||||
mTwitterPage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_TWITTER));
|
||||
mTwitterPage.setOnLongClickListener((v) -> copyUrl(mTwitterPage, Metadata.MetadataType.FMD_CONTACT_TWITTER));
|
||||
|
||||
mVkPage = mFrame.findViewById(R.id.ll__place_vk);
|
||||
mTvVkPage = mFrame.findViewById(R.id.tv__place_vk_page);
|
||||
mVkPage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_VK));
|
||||
mVkPage.setOnLongClickListener((v) -> copyUrl(mVkPage, Metadata.MetadataType.FMD_CONTACT_VK));
|
||||
|
||||
mLinePage = mFrame.findViewById(R.id.ll__place_line);
|
||||
mTvLinePage = mFrame.findViewById(R.id.tv__place_line_page);
|
||||
mLinePage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_LINE));
|
||||
mLinePage.setOnLongClickListener((v) -> copyUrl(mLinePage, Metadata.MetadataType.FMD_CONTACT_LINE));
|
||||
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(PlacePageViewModel.class);
|
||||
viewModel.getMapObject().observe(requireActivity(), this);
|
||||
}
|
||||
|
||||
private boolean isSocialUsername(Metadata.MetadataType type)
|
||||
{
|
||||
return !mMapObject.getMetadata(type).contains("/");
|
||||
}
|
||||
|
||||
private void openUrl(Metadata.MetadataType type)
|
||||
{
|
||||
final String url = getLink(type);
|
||||
if (type != Metadata.MetadataType.FMD_CONTACT_LINE || !isSocialUsername(type))
|
||||
Utils.openUrl(requireContext(), url);
|
||||
}
|
||||
|
||||
private String getLink(Metadata.MetadataType type)
|
||||
{
|
||||
final String metadata = mMapObject.getMetadata(type);
|
||||
if (TextUtils.isEmpty(metadata))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
String path = "";
|
||||
String domain = "";
|
||||
switch (type)
|
||||
{
|
||||
case FMD_WEBSITE:
|
||||
path = getWebsiteUrl(mMapObject);
|
||||
break;
|
||||
case FMD_CONTACT_FACEBOOK:
|
||||
domain = "https://m.facebook.com/";
|
||||
break;
|
||||
case FMD_CONTACT_INSTAGRAM:
|
||||
domain = "https://instagram.com/";
|
||||
break;
|
||||
case FMD_CONTACT_TWITTER:
|
||||
domain = "https://mobile.twitter.com/";
|
||||
break;
|
||||
case FMD_CONTACT_VK:
|
||||
domain = "https://vk.com/";
|
||||
break;
|
||||
case FMD_CONTACT_LINE:
|
||||
path = getLineUrl();
|
||||
break;
|
||||
}
|
||||
if (TextUtils.isEmpty(path))
|
||||
path = metadata;
|
||||
return domain + path;
|
||||
}
|
||||
|
||||
private boolean copyUrl(View view, Metadata.MetadataType type)
|
||||
{
|
||||
final String url = getLink(type);
|
||||
final List<String> items = new ArrayList<>();
|
||||
items.add(url);
|
||||
|
||||
final String metadata = type == Metadata.MetadataType.FMD_WEBSITE ? getWebsiteUrl(mMapObject) : mMapObject.getMetadata(type);
|
||||
// Add user names for social media if available
|
||||
if (!metadata.equals(url) && isSocialUsername(type))
|
||||
items.add(metadata);
|
||||
|
||||
if (items.size() == 1)
|
||||
PlacePageUtils.copyToClipboard(requireContext(), mFrame, items.get(0));
|
||||
else
|
||||
PlacePageUtils.showCopyPopup(requireContext(), view, mFrame, items);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void refreshSocialPageLink(View view, TextView tvSocialPage, String socialPage, String webDomain)
|
||||
{
|
||||
if (TextUtils.isEmpty(socialPage))
|
||||
view.setVisibility(GONE);
|
||||
else if (socialPage.indexOf('/') >= 0)
|
||||
refreshMetadataOrHide("https://" + webDomain + "/" + socialPage, view, tvSocialPage);
|
||||
else
|
||||
refreshMetadataOrHide("@" + socialPage, view, tvSocialPage);
|
||||
}
|
||||
|
||||
private void refreshSocialPageLink(View view, TextView tvSocialPage, String socialPage)
|
||||
{
|
||||
if (TextUtils.isEmpty(socialPage))
|
||||
view.setVisibility(GONE);
|
||||
else if (socialPage.indexOf('/') >= 0)
|
||||
refreshMetadataOrHide("https://" + socialPage, view, tvSocialPage);
|
||||
else
|
||||
refreshMetadataOrHide("@" + socialPage, view, tvSocialPage);
|
||||
}
|
||||
|
||||
private static String getWebsiteUrl(MapObject mapObject)
|
||||
{
|
||||
String website = mapObject.getMetadata(Metadata.MetadataType.FMD_WEBSITE);
|
||||
String url = mapObject.getMetadata(Metadata.MetadataType.FMD_URL);
|
||||
return TextUtils.isEmpty(website) ? url : website;
|
||||
}
|
||||
|
||||
private String getLineUrl()
|
||||
{
|
||||
final String metadata = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_LINE);
|
||||
if (isSocialUsername(Metadata.MetadataType.FMD_CONTACT_LINE))
|
||||
return "https://line.me/R/ti/p/@" + metadata;
|
||||
else
|
||||
return "https://" + metadata;
|
||||
}
|
||||
|
||||
private void refreshLinks()
|
||||
{
|
||||
refreshMetadataOrHide(getWebsiteUrl(mMapObject), mWebsite, mTvWebsite);
|
||||
String wikimedia_commons = mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIMEDIA_COMMONS);
|
||||
String wikimedia_commons_text = TextUtils.isEmpty(wikimedia_commons) ? "" : getResources().getString(R.string.wikimedia_commons);
|
||||
refreshMetadataOrHide(wikimedia_commons_text, mWikimedia, mTvWikimedia);
|
||||
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_EMAIL), mEmail, mTvEmail);
|
||||
|
||||
final String facebookPageLink = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_FACEBOOK);
|
||||
refreshSocialPageLink(mFacebookPage, mTvFacebookPage, facebookPageLink, "facebook.com");
|
||||
final String instagramPageLink = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_INSTAGRAM);
|
||||
refreshSocialPageLink(mInstagramPage, mTvInstagramPage, instagramPageLink, "instagram.com");
|
||||
final String twitterPageLink = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_TWITTER);
|
||||
refreshSocialPageLink(mTwitterPage, mTvTwitterPage, twitterPageLink, "twitter.com");
|
||||
final String vkPageLink = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_VK);
|
||||
refreshSocialPageLink(mVkPage, mTvVkPage, vkPageLink, "vk.com");
|
||||
final String linePageLink = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_LINE);
|
||||
// Tag `contact:line` could contain urls from domains: line.me, liff.line.me, page.line.me, etc.
|
||||
// And `socialPage` should not be prepended with domain, but only with "https://" protocol.
|
||||
refreshSocialPageLink(mLinePage, mTvLinePage, linePageLink);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
super.onDestroy();
|
||||
viewModel.getMapObject().removeObserver(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChanged(MapObject mapObject)
|
||||
{
|
||||
mMapObject = mapObject;
|
||||
refreshLinks();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,193 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.bookmarks.data.MapObject;
|
||||
import app.organicmaps.bookmarks.data.Metadata;
|
||||
import app.organicmaps.editor.OpeningHours;
|
||||
import app.organicmaps.editor.data.TimeFormatUtils;
|
||||
import app.organicmaps.editor.data.Timespan;
|
||||
import app.organicmaps.editor.data.Timetable;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
|
||||
public class PlacePageOpeningHoursFragment extends Fragment implements Observer<MapObject>
|
||||
{
|
||||
private View mFrame;
|
||||
private TextView mTodayLabel;
|
||||
private TextView mTodayOpenTime;
|
||||
private TextView mTodayNonBusinessTime;
|
||||
private RecyclerView mFullWeekOpeningHours;
|
||||
private PlaceOpeningHoursAdapter mOpeningHoursAdapter;
|
||||
|
||||
private PlacePageViewModel viewModel;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
return inflater.inflate(R.layout.place_page_opening_hours_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mFrame = view;
|
||||
mTodayLabel = view.findViewById(R.id.oh_today_label);
|
||||
mTodayOpenTime = view.findViewById(R.id.oh_today_open_time);
|
||||
mTodayNonBusinessTime = view.findViewById(R.id.oh_nonbusiness_time);
|
||||
mFullWeekOpeningHours = view.findViewById(R.id.rw__full_opening_hours);
|
||||
mOpeningHoursAdapter = new PlaceOpeningHoursAdapter();
|
||||
mFullWeekOpeningHours.setAdapter(mOpeningHoursAdapter);
|
||||
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(PlacePageViewModel.class);
|
||||
viewModel.getMapObject().observe(requireActivity(), this);
|
||||
}
|
||||
|
||||
private void refreshTodayNonBusinessTime(Timespan[] closedTimespans)
|
||||
{
|
||||
final String hoursClosedLabel = getResources().getString(R.string.editor_hours_closed);
|
||||
if (closedTimespans == null || closedTimespans.length == 0)
|
||||
UiUtils.clearTextAndHide(mTodayNonBusinessTime);
|
||||
else
|
||||
UiUtils.setTextAndShow(mTodayNonBusinessTime, TimeFormatUtils.formatNonBusinessTime(closedTimespans, hoursClosedLabel));
|
||||
}
|
||||
|
||||
private void refreshTodayOpeningHours(String label, String openTime, @ColorInt int color)
|
||||
{
|
||||
UiUtils.setTextAndShow(mTodayLabel, label);
|
||||
UiUtils.setTextAndShow(mTodayOpenTime, openTime);
|
||||
|
||||
mTodayLabel.setTextColor(color);
|
||||
mTodayOpenTime.setTextColor(color);
|
||||
}
|
||||
|
||||
private void refreshTodayOpeningHours(String label, @ColorInt int color)
|
||||
{
|
||||
UiUtils.setTextAndShow(mTodayLabel, label);
|
||||
UiUtils.hide(mTodayOpenTime);
|
||||
|
||||
mTodayLabel.setTextColor(color);
|
||||
mTodayOpenTime.setTextColor(color);
|
||||
}
|
||||
|
||||
private void refreshOpeningHours()
|
||||
{
|
||||
final String ohStr = viewModel.getMapObject()
|
||||
.getValue()
|
||||
.getMetadata(Metadata.MetadataType.FMD_OPEN_HOURS);
|
||||
final Timetable[] timetables = OpeningHours.nativeTimetablesFromString(ohStr);
|
||||
mFrame.setOnLongClickListener((v) -> {
|
||||
PlacePageUtils.copyToClipboard(requireContext(), mFrame, TimeFormatUtils.formatTimetables(getResources(), ohStr, timetables));
|
||||
return true;
|
||||
});
|
||||
|
||||
final boolean isEmptyTT = (timetables == null || timetables.length == 0);
|
||||
final int color = ThemeUtils.getColor(requireContext(), android.R.attr.textColorPrimary);
|
||||
|
||||
if (isEmptyTT)
|
||||
{
|
||||
// 'opening_hours' tag wasn't parsed either because it's empty or wrong format.
|
||||
if (!ohStr.isEmpty())
|
||||
{
|
||||
UiUtils.show(mFrame);
|
||||
refreshTodayOpeningHours(ohStr, color);
|
||||
UiUtils.hide(mTodayNonBusinessTime);
|
||||
UiUtils.hide(mFullWeekOpeningHours);
|
||||
}
|
||||
else
|
||||
UiUtils.hide(mFrame);
|
||||
}
|
||||
else
|
||||
{
|
||||
UiUtils.show(mFrame);
|
||||
final Resources resources = getResources();
|
||||
if (timetables[0].isFullWeek())
|
||||
{
|
||||
final Timetable tt = timetables[0];
|
||||
if (tt.isFullday)
|
||||
{
|
||||
refreshTodayOpeningHours(resources.getString(R.string.twentyfour_seven), color);
|
||||
UiUtils.clearTextAndHide(mTodayNonBusinessTime);
|
||||
UiUtils.hide(mTodayNonBusinessTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
refreshTodayOpeningHours(resources.getString(R.string.daily), tt.workingTimespan.toWideString(), color);
|
||||
refreshTodayNonBusinessTime(tt.closedTimespans);
|
||||
}
|
||||
UiUtils.hide(mFullWeekOpeningHours);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Show whole week time table.
|
||||
int firstDayOfWeek = Calendar.getInstance(Locale.getDefault()).getFirstDayOfWeek();
|
||||
mOpeningHoursAdapter.setTimetables(timetables, firstDayOfWeek);
|
||||
UiUtils.show(mFullWeekOpeningHours);
|
||||
|
||||
// Show today's open time + non-business time.
|
||||
boolean containsCurrentWeekday = false;
|
||||
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
|
||||
for (Timetable tt : timetables)
|
||||
{
|
||||
if (tt.containsWeekday(currentDay))
|
||||
{
|
||||
containsCurrentWeekday = true;
|
||||
String openTime;
|
||||
|
||||
if (tt.isFullday)
|
||||
{
|
||||
String allDay = resources.getString(R.string.editor_time_allday);
|
||||
openTime = Utils.unCapitalize(allDay);
|
||||
}
|
||||
else
|
||||
openTime = tt.workingTimespan.toWideString();
|
||||
|
||||
refreshTodayOpeningHours(resources.getString(R.string.today), openTime, color);
|
||||
refreshTodayNonBusinessTime(tt.closedTimespans);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Show that place is closed today.
|
||||
if (!containsCurrentWeekday)
|
||||
{
|
||||
refreshTodayOpeningHours(resources.getString(R.string.day_off_today), resources.getColor(R.color.base_red));
|
||||
UiUtils.hide(mTodayNonBusinessTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
super.onDestroy();
|
||||
viewModel.getMapObject().removeObserver(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChanged(MapObject mapObject)
|
||||
{
|
||||
refreshOpeningHours();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
package app.organicmaps.widget.placepage;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import android.os.Bundle;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import android.view.LayoutInflater;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import android.view.View;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import android.view.ViewGroup;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import androidx.annotation.NonNull;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import androidx.annotation.Nullable;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import androidx.fragment.app.Fragment;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import androidx.lifecycle.Observer;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import app.organicmaps.R;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import app.organicmaps.bookmarks.data.MapObject;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
import app.organicmaps.bookmarks.data.Metadata;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
public class PlacePagePhoneFragment extends Fragment implements Observer<MapObject>
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
{
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
private PlacePhoneAdapter mPhoneAdapter;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
private PlacePageViewModel viewModel;
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
@Nullable
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
@Override
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
{
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
return inflater.inflate(R.layout.place_page_phone_fragment, container, false);
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
}
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
@Override
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
{
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
RecyclerView phoneRecycler = view.findViewById(R.id.rw__phone);
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
mPhoneAdapter = new PlacePhoneAdapter();
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
phoneRecycler.setAdapter(mPhoneAdapter);
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(PlacePageViewModel.class);
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
viewModel.getMapObject().observe(requireActivity(), this);
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
}
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
@Override
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
public void onDestroy()
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
{
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
super.onDestroy();
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
viewModel.getMapObject().removeObserver(this);
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
}
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
@Override
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
public void onChanged(MapObject mapObject)
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
{
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
mPhoneAdapter.refreshPhones(mapObject.getMetadata(Metadata.MetadataType.FMD_PHONE_NUMBER));
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
}
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
||||
}
|
||||
![]() When it can be null? Does crashing here help to fix wrong code? When it can be null? Does crashing here help to fix wrong code?
|
|
@ -1,19 +1,22 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.view.Menu;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.PopupMenu;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import app.organicmaps.Framework;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.util.Utils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class PlacePageUtils
|
||||
{
|
||||
static final String EXTRA_PLACE_PAGE_DATA = "extra_place_page_data";
|
||||
|
||||
static void moveViewportUp(@NonNull View placePageView, int viewportMinHeight)
|
||||
{
|
||||
placePageView.post(() -> {
|
||||
|
@ -75,6 +78,11 @@ class PlacePageUtils
|
|||
return state == BottomSheetBehavior.STATE_COLLAPSED;
|
||||
}
|
||||
|
||||
static boolean isHalfExpandedState(@BottomSheetBehavior.State int state)
|
||||
{
|
||||
return state == BottomSheetBehavior.STATE_HALF_EXPANDED;
|
||||
}
|
||||
|
||||
static boolean isExpandedState(@BottomSheetBehavior.State int state)
|
||||
{
|
||||
return state == BottomSheetBehavior.STATE_EXPANDED;
|
||||
|
@ -106,4 +114,29 @@ class PlacePageUtils
|
|||
throw new AssertionError("Unsupported state detected: " + state);
|
||||
}
|
||||
}
|
||||
|
||||
static void copyToClipboard(Context context, View frame, String text)
|
||||
{
|
||||
Utils.copyTextToClipboard(context, text);
|
||||
Utils.showSnackbarAbove(frame,
|
||||
frame.getRootView().findViewById(R.id.pp_buttons_layout),
|
||||
context.getString(R.string.copied_to_clipboard, text));
|
||||
}
|
||||
|
||||
static void showCopyPopup(Context context, View popupAnchor, View frame, List<String> items)
|
||||
{
|
||||
final PopupMenu popup = new PopupMenu(context, popupAnchor);
|
||||
final Menu menu = popup.getMenu();
|
||||
final String copyText = context.getResources().getString(android.R.string.copy);
|
||||
|
||||
for (int i = 0; i < items.size(); i++)
|
||||
menu.add(Menu.NONE, i, i, String.format("%s %s", copyText, items.get(i)));
|
||||
|
||||
popup.setOnMenuItemClickListener(item -> {
|
||||
final String text = items.get(item.getItemId());
|
||||
copyToClipboard(context, frame, text);
|
||||
return true;
|
||||
});
|
||||
popup.show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
import app.organicmaps.bookmarks.data.MapObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PlacePageViewModel extends ViewModel
|
||||
{
|
||||
private final MutableLiveData<List<PlacePageButtons.ButtonType>> mCurrentButtons = new MutableLiveData<>();
|
||||
private final MutableLiveData<MapObject> mMapObject = new MutableLiveData<>();
|
||||
|
||||
public LiveData<List<PlacePageButtons.ButtonType>> getCurrentButtons()
|
||||
{
|
||||
return mCurrentButtons;
|
||||
}
|
||||
|
||||
public void setCurrentButtons(List<PlacePageButtons.ButtonType> buttons)
|
||||
{
|
||||
mCurrentButtons.setValue(buttons);
|
||||
}
|
||||
|
||||
public MutableLiveData<MapObject> getMapObject()
|
||||
{
|
||||
return mMapObject;
|
||||
}
|
||||
|
||||
public void setMapObject(MapObject mapObject)
|
||||
{
|
||||
mMapObject.setValue(mapObject);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.bookmarks.data.MapObject;
|
||||
import app.organicmaps.bookmarks.data.Metadata;
|
||||
import app.organicmaps.util.Utils;
|
||||
|
||||
public class PlacePageWikipediaFragment extends Fragment implements Observer<MapObject>
|
||||
{
|
||||
private View mFrame;
|
||||
private View mWiki;
|
||||
|
||||
private TextView mPlaceDescriptionView;
|
||||
|
||||
private PlacePageViewModel viewModel;
|
||||
|
||||
private MapObject mMapObject;
|
||||
|
||||
private int mDescriptionMaxLength;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
return inflater.inflate(R.layout.place_page_wikipedia_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mDescriptionMaxLength = getResources().getInteger(R.integer.place_page_description_max_length);
|
||||
|
||||
mFrame = view;
|
||||
|
||||
mPlaceDescriptionView = view.findViewById(R.id.poi_description);
|
||||
View placeDescriptionMoreBtn = view.findViewById(R.id.more_btn);
|
||||
placeDescriptionMoreBtn.setOnClickListener(v -> showDescriptionScreen());
|
||||
mWiki = view.findViewById(R.id.ll__place_wiki);
|
||||
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(PlacePageViewModel.class);
|
||||
viewModel.getMapObject().observe(requireActivity(), this);
|
||||
}
|
||||
|
||||
private void showDescriptionScreen()
|
||||
{
|
||||
PlaceDescriptionActivity.start(requireContext(), mMapObject.getDescription());
|
||||
}
|
||||
|
||||
private Spanned getShortDescription()
|
||||
{
|
||||
String htmlDescription = mMapObject.getDescription();
|
||||
final int paragraphStart = htmlDescription.indexOf("<p>");
|
||||
final int paragraphEnd = htmlDescription.indexOf("</p>");
|
||||
if (paragraphStart == 0 && paragraphEnd != -1)
|
||||
htmlDescription = htmlDescription.substring(3, paragraphEnd);
|
||||
|
||||
Spanned description = Html.fromHtml(htmlDescription);
|
||||
if (description.length() > mDescriptionMaxLength)
|
||||
{
|
||||
description = (Spanned) new SpannableStringBuilder(description)
|
||||
.insert(mDescriptionMaxLength - 3, "...")
|
||||
.subSequence(0, mDescriptionMaxLength);
|
||||
}
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
private void updateViews()
|
||||
{
|
||||
mPlaceDescriptionView.setText(getShortDescription());
|
||||
mPlaceDescriptionView.setOnLongClickListener((v) -> {
|
||||
PlacePageUtils.copyToClipboard(requireContext(), mFrame, mPlaceDescriptionView.getText()
|
||||
.toString());
|
||||
return true;
|
||||
});
|
||||
final String wikipediaLink = mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA);
|
||||
mWiki.setOnClickListener((v) -> Utils.openUrl(requireContext(), wikipediaLink));
|
||||
mWiki.setOnLongClickListener((v) -> {
|
||||
PlacePageUtils.copyToClipboard(requireContext(), mFrame, wikipediaLink);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
super.onDestroy();
|
||||
viewModel.getMapObject().removeObserver(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChanged(MapObject mapObject)
|
||||
{
|
||||
mMapObject = mapObject;
|
||||
updateViews();
|
||||
}
|
||||
}
|
|
@ -1,349 +0,0 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.res.Resources;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.GestureDetectorCompat;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import app.organicmaps.Framework;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.bookmarks.data.MapObject;
|
||||
import app.organicmaps.location.LocationHelper;
|
||||
import app.organicmaps.location.LocationListener;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetItem;
|
||||
import app.organicmaps.util.log.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
public class RichPlacePageController implements PlacePageController, LocationListener, Closable
|
||||
{
|
||||
private static final String TAG = RichPlacePageController.class.getSimpleName();
|
||||
|
||||
private static final float PREVIEW_PLUS_RATIO = 0.45f;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private BottomSheetBehavior<View> mPlacePageBehavior;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private View mButtonsLayout;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private PlacePageView mPlacePage;
|
||||
private int mViewportMinHeight;
|
||||
@NonNull
|
||||
private final SlideListener mSlideListener;
|
||||
@Nullable
|
||||
private final RoutingModeListener mRoutingModeListener;
|
||||
@NonNull
|
||||
private final BottomSheetChangedListener mBottomSheetChangedListener = new BottomSheetChangedListener()
|
||||
{
|
||||
@Override
|
||||
public void onSheetHidden()
|
||||
{
|
||||
onHiddenInternal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetDetailsOpened()
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetCollapsed()
|
||||
{
|
||||
mPlacePage.resetScroll();
|
||||
setPeekHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetSliding(int top)
|
||||
{
|
||||
mSlideListener.onPlacePageSlide(top);
|
||||
// mPlacePageTracker.onMove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetSlideFinish()
|
||||
{
|
||||
PlacePageUtils.moveViewportUp(mPlacePage, mViewportMinHeight);
|
||||
}
|
||||
};
|
||||
|
||||
@NonNull
|
||||
private final BottomSheetBehavior.BottomSheetCallback mSheetCallback
|
||||
= new DefaultBottomSheetCallback(mBottomSheetChangedListener);
|
||||
|
||||
private boolean mDeactivateMapSelection = true;
|
||||
|
||||
private void onHiddenInternal()
|
||||
{
|
||||
if (mDeactivateMapSelection)
|
||||
Framework.nativeDeactivatePopup();
|
||||
mDeactivateMapSelection = true;
|
||||
PlacePageUtils.moveViewportUp(mPlacePage, mViewportMinHeight);
|
||||
UiUtils.invisible(mButtonsLayout);
|
||||
}
|
||||
|
||||
RichPlacePageController(@NonNull SlideListener listener,
|
||||
@Nullable RoutingModeListener routingModeListener)
|
||||
{
|
||||
mSlideListener = listener;
|
||||
mRoutingModeListener = routingModeListener;
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public void initialize(@Nullable Activity activity)
|
||||
{
|
||||
Objects.requireNonNull(activity);
|
||||
Resources res = activity.getResources();
|
||||
mViewportMinHeight = res.getDimensionPixelSize(R.dimen.viewport_min_height);
|
||||
mPlacePage = activity.findViewById(R.id.placepage);
|
||||
mPlacePageBehavior = BottomSheetBehavior.from(mPlacePage);
|
||||
mPlacePageBehavior.addBottomSheetCallback(mSheetCallback);
|
||||
mPlacePageBehavior.setHideable(true);
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
PlacePageGestureListener ppGestureListener = new PlacePageGestureListener(mPlacePageBehavior);
|
||||
GestureDetectorCompat gestureDetector = new GestureDetectorCompat(activity, ppGestureListener);
|
||||
mPlacePage.addPlacePageGestureListener(ppGestureListener);
|
||||
mPlacePage.setOnTouchListener((v, event) -> gestureDetector.onTouchEvent(event));
|
||||
mPlacePage.addClosable(this);
|
||||
mPlacePage.setRoutingModeListener(mRoutingModeListener);
|
||||
mPlacePage.setOnPlacePageContentChangeListener(this::setPeekHeight);
|
||||
|
||||
mButtonsLayout = activity.findViewById(R.id.pp_buttons_layout);
|
||||
ViewGroup buttons = mButtonsLayout.findViewById(R.id.container);
|
||||
mPlacePage.initButtons(buttons);
|
||||
UiUtils.bringViewToFrontOf(mButtonsLayout, mPlacePage);
|
||||
LocationHelper.INSTANCE.addListener(this);
|
||||
|
||||
mButtonsLayout.setOnApplyWindowInsetsListener((view, windowInsets) -> {
|
||||
UiUtils.setViewInsetsPaddingNoTop(mButtonsLayout, windowInsets);
|
||||
return windowInsets;
|
||||
});
|
||||
mPlacePage.requestApplyInsets();
|
||||
}
|
||||
|
||||
public int getPlacePageWidth()
|
||||
{
|
||||
return mPlacePage.getWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ArrayList<MenuBottomSheetItem> getMenuBottomSheetItems()
|
||||
{
|
||||
return mPlacePage.getMenuBottomSheetItems();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
LocationHelper.INSTANCE.removeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openFor(@NonNull PlacePageData data)
|
||||
{
|
||||
mDeactivateMapSelection = true;
|
||||
MapObject object = (MapObject) data;
|
||||
mPlacePage.setMapObject(object, (isSameObject) -> {
|
||||
@BottomSheetBehavior.State
|
||||
int state = mPlacePageBehavior.getState();
|
||||
if (isSameObject && !PlacePageUtils.isHiddenState(state))
|
||||
return;
|
||||
|
||||
mPlacePage.resetScroll();
|
||||
|
||||
if (object.getOpeningMode() == MapObject.OPENING_MODE_DETAILS)
|
||||
{
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
return;
|
||||
}
|
||||
|
||||
UiUtils.show(mButtonsLayout);
|
||||
openPlacePage();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void openPlacePage()
|
||||
{
|
||||
mPlacePage.post(() -> {
|
||||
setPeekHeight();
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
});
|
||||
}
|
||||
|
||||
private void setPeekHeight()
|
||||
{
|
||||
final int peekHeight = calculatePeekHeight();
|
||||
if (peekHeight == mPlacePageBehavior.getPeekHeight())
|
||||
return;
|
||||
|
||||
@BottomSheetBehavior.State
|
||||
int currentState = mPlacePageBehavior.getState();
|
||||
if (PlacePageUtils.isSettlingState(currentState) || PlacePageUtils.isDraggingState(currentState))
|
||||
{
|
||||
Logger.d(TAG, "Sheet state inappropriate, ignore.");
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean shouldAnimate = PlacePageUtils.isCollapsedState(currentState) && mPlacePageBehavior.getPeekHeight() > 0;
|
||||
mPlacePageBehavior.setPeekHeight(peekHeight, shouldAnimate);
|
||||
}
|
||||
|
||||
private int calculatePeekHeight()
|
||||
{
|
||||
// Buttons layout padding is the navigation bar height.
|
||||
// Bottom sheets are displayed above it so we need to remove it from the computed size
|
||||
final int organicPeekHeight = mPlacePage.getPreviewHeight() +
|
||||
mButtonsLayout.getHeight() - mButtonsLayout.getPaddingBottom();
|
||||
final MapObject object = mPlacePage.getMapObject();
|
||||
if (object != null)
|
||||
{
|
||||
@MapObject.OpeningMode
|
||||
int mode = object.getOpeningMode();
|
||||
if (mode == MapObject.OPENING_MODE_PREVIEW_PLUS)
|
||||
{
|
||||
View parent = (View) mPlacePage.getParent();
|
||||
int promoPeekHeight = (int) (parent.getHeight() * PREVIEW_PLUS_RATIO);
|
||||
return Math.max(promoPeekHeight, organicPeekHeight);
|
||||
}
|
||||
}
|
||||
|
||||
return organicPeekHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(boolean deactivateMapSelection)
|
||||
{
|
||||
mDeactivateMapSelection = deactivateMapSelection;
|
||||
mPlacePageBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
mPlacePage.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed()
|
||||
{
|
||||
return PlacePageUtils.isHiddenState(mPlacePageBehavior.getState());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationUpdated(@NonNull Location location)
|
||||
{
|
||||
mPlacePage.refreshLocation(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompassUpdated(double north)
|
||||
{
|
||||
@BottomSheetBehavior.State
|
||||
int currentState = mPlacePageBehavior.getState();
|
||||
if (PlacePageUtils.isHiddenState(currentState))
|
||||
return;
|
||||
|
||||
mPlacePage.refreshAzimuth(north);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSave(@NonNull Bundle outState)
|
||||
{
|
||||
outState.putParcelable(PlacePageUtils.EXTRA_PLACE_PAGE_DATA, mPlacePage.getMapObject());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestore(@NonNull Bundle inState)
|
||||
{
|
||||
if (mPlacePageBehavior.getState() == BottomSheetBehavior.STATE_HIDDEN)
|
||||
return;
|
||||
|
||||
if (!Framework.nativeHasPlacePageInfo())
|
||||
{
|
||||
close(false);
|
||||
return;
|
||||
}
|
||||
|
||||
MapObject object = Utils.getParcelable(inState, PlacePageUtils.EXTRA_PLACE_PAGE_DATA, MapObject.class);
|
||||
if (object == null)
|
||||
return;
|
||||
|
||||
@BottomSheetBehavior.State
|
||||
int state = mPlacePageBehavior.getState();
|
||||
mPlacePage.setMapObject(object, (isSameObject) -> restorePlacePageState(state));
|
||||
}
|
||||
|
||||
private void restorePlacePageState(@BottomSheetBehavior.State int state)
|
||||
{
|
||||
mPlacePage.post(() -> {
|
||||
mPlacePageBehavior.setState(state);
|
||||
UiUtils.show(mButtonsLayout);
|
||||
setPeekHeight();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState)
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity)
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity)
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity)
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity)
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState)
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity)
|
||||
{
|
||||
// No op.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closePlacePage()
|
||||
{
|
||||
close(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean support(@NonNull PlacePageData data)
|
||||
{
|
||||
return data instanceof MapObject;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import app.organicmaps.settings.RoadType;
|
||||
|
||||
public interface RoutingModeListener
|
||||
{
|
||||
void toggleRouteSettings(@NonNull RoadType roadType);
|
||||
}
|
|
@ -1,288 +0,0 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.GestureDetectorCompat;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import app.organicmaps.Framework;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SimplePlacePageController implements PlacePageController
|
||||
{
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private Application mApplication;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private View mSheet;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private BottomSheetBehavior<View> mSheetBehavior;
|
||||
@NonNull
|
||||
private final SlideListener mSlideListener;
|
||||
private int mViewportMinHeight;
|
||||
private int mViewPortMinWidth;
|
||||
@NonNull
|
||||
private final PlacePageViewRenderer<PlacePageData> mViewRenderer;
|
||||
@Nullable
|
||||
private final PlacePageStateListener mStateListener;
|
||||
@NonNull
|
||||
private final BottomSheetChangedListener mBottomSheetChangedListener =
|
||||
new BottomSheetChangedListener()
|
||||
{
|
||||
@Override
|
||||
public void onSheetHidden()
|
||||
{
|
||||
onHiddenInternal();
|
||||
if (mStateListener != null)
|
||||
mStateListener.onPlacePageClosed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetDetailsOpened()
|
||||
{
|
||||
if (UiUtils.isLandscape(mApplication))
|
||||
PlacePageUtils.moveViewPortRight(mSheet, mViewPortMinWidth);
|
||||
if (mStateListener != null)
|
||||
mStateListener.onPlacePageDetails();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetCollapsed()
|
||||
{
|
||||
if (UiUtils.isLandscape(mApplication))
|
||||
PlacePageUtils.moveViewPortRight(mSheet, mViewPortMinWidth);
|
||||
if (mStateListener != null)
|
||||
mStateListener.onPlacePagePreview();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetSliding(int top)
|
||||
{
|
||||
if (UiUtils.isLandscape(mApplication))
|
||||
return;
|
||||
|
||||
mSlideListener.onPlacePageSlide(top);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSheetSlideFinish()
|
||||
{
|
||||
if (UiUtils.isLandscape(mApplication))
|
||||
return;
|
||||
|
||||
PlacePageUtils.moveViewportUp(mSheet, mViewportMinHeight);
|
||||
}
|
||||
};
|
||||
|
||||
private final BottomSheetBehavior.BottomSheetCallback mSheetCallback
|
||||
= new DefaultBottomSheetCallback(mBottomSheetChangedListener);
|
||||
|
||||
private boolean mDeactivateMapSelection = true;
|
||||
@IdRes
|
||||
private final int mSheetResId;
|
||||
|
||||
SimplePlacePageController(int sheetResId, @NonNull PlacePageViewRenderer<PlacePageData> renderer,
|
||||
@Nullable PlacePageStateListener stateListener,
|
||||
@NonNull SlideListener slideListener)
|
||||
{
|
||||
mSheetResId = sheetResId;
|
||||
mSlideListener = slideListener;
|
||||
mViewRenderer = renderer;
|
||||
mStateListener = stateListener;
|
||||
}
|
||||
|
||||
public int getPlacePageWidth()
|
||||
{
|
||||
return mSheet.getWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ArrayList<MenuBottomSheetItem> getMenuBottomSheetItems()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openFor(@NonNull PlacePageData data)
|
||||
{
|
||||
mDeactivateMapSelection = true;
|
||||
mViewRenderer.render(data);
|
||||
if (mSheetBehavior.getSkipCollapsed())
|
||||
mSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
else
|
||||
mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(boolean deactivateMapSelection)
|
||||
{
|
||||
mDeactivateMapSelection = deactivateMapSelection;
|
||||
mSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed()
|
||||
{
|
||||
return PlacePageUtils.isHiddenState(mSheetBehavior.getState());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public void initialize(@Nullable Activity activity)
|
||||
{
|
||||
Objects.requireNonNull(activity);
|
||||
mApplication = activity.getApplication();
|
||||
mSheet = activity.findViewById(mSheetResId);
|
||||
mViewportMinHeight = mSheet.getResources().getDimensionPixelSize(R.dimen.viewport_min_height);
|
||||
mViewPortMinWidth = mSheet.getResources().getDimensionPixelSize(R.dimen.viewport_min_width);
|
||||
mSheetBehavior = BottomSheetBehavior.from(mSheet);
|
||||
mSheetBehavior.addBottomSheetCallback(mSheetCallback);
|
||||
mSheetBehavior.setHideable(true);
|
||||
mSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
boolean isLandscape = UiUtils.isLandscape(mApplication);
|
||||
GestureDetectorCompat gestureDetector = new GestureDetectorCompat(
|
||||
activity, new SimplePlacePageGestureListener(mSheetBehavior, isLandscape));
|
||||
mSheet.setOnTouchListener((v, event) -> gestureDetector.onTouchEvent(event));
|
||||
mViewRenderer.initialize(mSheet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
mViewRenderer.destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSave(@NonNull Bundle outState)
|
||||
{
|
||||
mViewRenderer.onSave(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestore(@NonNull Bundle inState)
|
||||
{
|
||||
if (PlacePageUtils.isHiddenState(mSheetBehavior.getState()))
|
||||
return;
|
||||
|
||||
if (!Framework.nativeHasPlacePageInfo())
|
||||
{
|
||||
close(false);
|
||||
return;
|
||||
}
|
||||
|
||||
mViewRenderer.onRestore(inState);
|
||||
if (UiUtils.isLandscape(mApplication))
|
||||
{
|
||||
// In case when bottom sheet was collapsed for vertical orientation then after rotation
|
||||
// we should expand bottom sheet forcibly for horizontal orientation. It's by design.
|
||||
if (!PlacePageUtils.isHiddenState(mSheetBehavior.getState()))
|
||||
{
|
||||
mSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void onHiddenInternal()
|
||||
{
|
||||
mViewRenderer.onHide();
|
||||
if (mDeactivateMapSelection)
|
||||
Framework.nativeDeactivatePopup();
|
||||
mDeactivateMapSelection = true;
|
||||
if (UiUtils.isLandscape(mApplication))
|
||||
{
|
||||
PlacePageUtils.moveViewPortRight(mSheet, mViewPortMinWidth);
|
||||
return;
|
||||
}
|
||||
|
||||
PlacePageUtils.moveViewportUp(mSheet, mViewportMinHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean support(@NonNull PlacePageData data)
|
||||
{
|
||||
return mViewRenderer.support(data);
|
||||
}
|
||||
|
||||
private static class SimplePlacePageGestureListener extends PlacePageGestureListener
|
||||
{
|
||||
private final boolean mLandscape;
|
||||
|
||||
SimplePlacePageGestureListener(@NonNull BottomSheetBehavior<View> bottomSheetBehavior,
|
||||
boolean landscape)
|
||||
{
|
||||
super(bottomSheetBehavior);
|
||||
mLandscape = landscape;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSingleTapConfirmed(MotionEvent e)
|
||||
{
|
||||
if (mLandscape)
|
||||
{
|
||||
getBottomSheetBehavior().setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.onSingleTapConfirmed(e);
|
||||
}
|
||||
}
|
||||
}
|
What is this elevation info?