From 0e4783c7586cb54fe2b2f88018a2226f244a432a Mon Sep 17 00:00:00 2001 From: Chumva Date: Mon, 23 Apr 2018 15:47:32 +0300 Subject: [PATCH] deleted unnecessary methods --- .../explore/travelcards/BaseTravelCard.java | 15 --------------- .../explore/travelcards/OpenBetaTravelCard.java | 1 + .../travelcards/StartEditingTravelCard.java | 9 ++------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/BaseTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/BaseTravelCard.java index 27e119380e..c295e8f46e 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/BaseTravelCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/BaseTravelCard.java @@ -4,7 +4,6 @@ import android.graphics.drawable.Drawable; import android.support.annotation.ColorInt; import android.support.annotation.ColorRes; import android.support.annotation.DrawableRes; -import android.support.annotation.LayoutRes; import android.support.annotation.StringRes; import android.support.v4.content.ContextCompat; import android.view.View; @@ -59,18 +58,4 @@ public abstract class BaseTravelCard { protected void onRightButtonClickAction() { } - - @ColorRes - protected int getBottomDividerColorId() { - return DEFAULT_VALUE; - } - - @LayoutRes - protected int getLayoutId() { - return DEFAULT_VALUE; - } - - protected boolean isNightMode() { - return !app.getSettings().isLightContent(); - } } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/OpenBetaTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/OpenBetaTravelCard.java index 8914aa5377..1ef2140992 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/OpenBetaTravelCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/OpenBetaTravelCard.java @@ -14,6 +14,7 @@ import net.osmand.plus.R; import net.osmand.plus.dialogs.ChoosePlanDialogFragment; public class OpenBetaTravelCard extends BaseTravelCard { + private FragmentManager fm; public OpenBetaTravelCard(OsmandApplication app, FragmentManager fm, boolean nightMode) { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/StartEditingTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/StartEditingTravelCard.java index 55366b1715..57eb92cbbe 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/StartEditingTravelCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/StartEditingTravelCard.java @@ -32,7 +32,7 @@ public class StartEditingTravelCard extends BaseTravelCard { public void inflate(OsmandApplication app, ViewGroup container, boolean nightMode) { final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme; view = LayoutInflater.from(new ContextThemeWrapper(app, themeRes)) - .inflate(getLayoutId(), container, false); + .inflate(R.layout.wikivoyage_start_editing_card, container, false); ImageView imageView = (ImageView) view.findViewById(R.id.background_image); imageView.setImageDrawable(getIcon(R.drawable.img_help_wikivoyage_contribute)); ((TextView) view.findViewById(R.id.title)).setText(R.string.start_editing_card_image_text); @@ -60,11 +60,6 @@ public class StartEditingTravelCard extends BaseTravelCard { return super.getIcon(drawableRes); } - @Override - protected int getLayoutId() { - return R.layout.wikivoyage_start_editing_card; - } - @Override protected int getLeftButtonTextId() { return R.string.start_editing; @@ -73,7 +68,7 @@ public class StartEditingTravelCard extends BaseTravelCard { @Override protected void onLeftButtonClickAction() { CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder() - .setToolbarColor(ContextCompat.getColor(app, isNightMode() ? R.color.actionbar_dark_color : R.color.actionbar_light_color)) + .setToolbarColor(ContextCompat.getColor(app, nightMode ? R.color.actionbar_dark_color : R.color.actionbar_light_color)) .build(); String text = "https://" + app.getLanguage().toLowerCase() + ".m.wikivoyage.org"; customTabsIntent.launchUrl(app, Uri.parse(text));