code cleaninng

This commit is contained in:
madwasp79 2019-05-28 15:49:37 +03:00
parent 17abdd3379
commit b9e0601a67
3 changed files with 5 additions and 3 deletions

View file

@ -551,7 +551,6 @@ public class ApplicationMode {
try {
return app.getResources().getIdentifier(variableName, "drawable", packageName);
} catch (Exception e) {
e.printStackTrace();
return -1;
}
}

View file

@ -43,6 +43,8 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
protected int themeRes;
private LinearLayout itemsContainer;
@StringRes
protected int dismissButtonStringRes = R.string.shared_string_cancel;
public void setUsedOnMap(boolean usedOnMap) {
@ -249,7 +251,7 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
return dismissButtonStringRes;
}
protected void setDismissButtonTextId(int stringRes) {
protected void setDismissButtonTextId(@StringRes int stringRes) {
dismissButtonStringRes = stringRes;
}

View file

@ -21,6 +21,7 @@ import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import net.osmand.AndroidUtils;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.R;
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
@ -118,7 +119,7 @@ public class AppModesBottomSheetDialogFragment extends MenuBottomSheetDialogFrag
R.layout.bottom_sheet_item_simple, null);
TextView textView = (TextView) textButtonView.findViewById(R.id.title);
int dpPadding = (int) (8 * getResources().getDisplayMetrics().density + 0.5f);
int dpPadding = AndroidUtils.dpToPx(getMyApplication(), 8);
textView.setPadding(dpPadding, 0, 0, 0);
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
textView.setTextColor(nightMode