renamed several files
This commit is contained in:
parent
ff116a08db
commit
7ea291e584
5 changed files with 29 additions and 30 deletions
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/favourites_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/bg_color"
|
|
@ -12,7 +12,7 @@ import android.widget.TextView;
|
|||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
|
||||
public class BottomSheetItemWithTitleAndButton extends BottomSheetItemWithDescription {
|
||||
public class BottomSheetItemTitleWithDescrAndButton extends BottomSheetItemWithDescription {
|
||||
|
||||
private View.OnClickListener onButtonClickListener;
|
||||
private Drawable leftCompoundDrawable;
|
||||
|
@ -23,22 +23,22 @@ public class BottomSheetItemWithTitleAndButton extends BottomSheetItemWithDescri
|
|||
|
||||
private TextView textButtonTV;
|
||||
|
||||
public BottomSheetItemWithTitleAndButton(View customView,
|
||||
@LayoutRes int layoutId,
|
||||
Object tag,
|
||||
boolean disabled,
|
||||
View.OnClickListener onClickListener,
|
||||
int position,
|
||||
Drawable icon,
|
||||
String title,
|
||||
@ColorRes int titleColorId,
|
||||
CharSequence description,
|
||||
@ColorRes int descriptionColorId,
|
||||
String buttonTitle,
|
||||
View.OnClickListener onButtonClickListener,
|
||||
Drawable leftCompoundDrawable,
|
||||
Drawable rightCompoundDrawable,
|
||||
@ColorRes int buttonTextColor) {
|
||||
public BottomSheetItemTitleWithDescrAndButton(View customView,
|
||||
@LayoutRes int layoutId,
|
||||
Object tag,
|
||||
boolean disabled,
|
||||
View.OnClickListener onClickListener,
|
||||
int position,
|
||||
Drawable icon,
|
||||
String title,
|
||||
@ColorRes int titleColorId,
|
||||
CharSequence description,
|
||||
@ColorRes int descriptionColorId,
|
||||
String buttonTitle,
|
||||
View.OnClickListener onButtonClickListener,
|
||||
Drawable leftCompoundDrawable,
|
||||
Drawable rightCompoundDrawable,
|
||||
@ColorRes int buttonTextColor) {
|
||||
super(customView, layoutId, tag, disabled, onClickListener, position, icon, title, titleColorId, description, descriptionColorId);
|
||||
this.buttonTitle = buttonTitle;
|
||||
this.onButtonClickListener = onButtonClickListener;
|
||||
|
@ -79,29 +79,29 @@ public class BottomSheetItemWithTitleAndButton extends BottomSheetItemWithDescri
|
|||
@ColorRes
|
||||
protected int buttonTextColor = INVALID_ID;
|
||||
|
||||
public BottomSheetItemWithTitleAndButton.Builder setButtonIcons(Drawable leftCompoundDrawable, Drawable rightCompoundDrawable) {
|
||||
public BottomSheetItemTitleWithDescrAndButton.Builder setButtonIcons(Drawable leftCompoundDrawable, Drawable rightCompoundDrawable) {
|
||||
this.leftCompoundDrawable = leftCompoundDrawable;
|
||||
this.rightCompoundDrawable = rightCompoundDrawable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetItemWithTitleAndButton.Builder setonButtonClickListener(View.OnClickListener onButtonClickListener) {
|
||||
public BottomSheetItemTitleWithDescrAndButton.Builder setonButtonClickListener(View.OnClickListener onButtonClickListener) {
|
||||
this.onButtonClickListener = onButtonClickListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetItemWithTitleAndButton.Builder setButtonTitle(String buttonTitle) {
|
||||
public BottomSheetItemTitleWithDescrAndButton.Builder setButtonTitle(String buttonTitle) {
|
||||
this.buttonTitle = buttonTitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetItemWithTitleAndButton.Builder setButtonTextColor(@ColorRes int buttonTextColor) {
|
||||
public BottomSheetItemTitleWithDescrAndButton.Builder setButtonTextColor(@ColorRes int buttonTextColor) {
|
||||
this.buttonTextColor = buttonTextColor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetItemWithTitleAndButton create() {
|
||||
return new BottomSheetItemWithTitleAndButton(customView,
|
||||
public BottomSheetItemTitleWithDescrAndButton create() {
|
||||
return new BottomSheetItemTitleWithDescrAndButton(customView,
|
||||
layoutId,
|
||||
tag,
|
||||
disabled,
|
|
@ -47,7 +47,7 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
|
|||
@Override
|
||||
public void inflate(OsmandApplication app, ViewGroup container, boolean nightMode) {
|
||||
super.inflate(app, container, nightMode);
|
||||
descriptionTv = (TextView) view.findViewById(R.id.description);
|
||||
descriptionTv = (TextView) view.findViewById(R.id.description);
|
||||
if (descriptionTv != null) {
|
||||
descriptionTv.setText(description);
|
||||
if (descriptionColorId != INVALID_ID) {
|
||||
|
|
|
@ -19,7 +19,7 @@ import net.osmand.plus.TargetPointsHelper;
|
|||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithTitleAndButton;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemTitleWithDescrAndButton;
|
||||
import net.osmand.plus.dashboard.DashLocationFragment;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class FavouritesBottomSheetMenuFragment extends MenuBottomSheetDialogFrag
|
|||
recyclerView = new RecyclerView(getContext());
|
||||
final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
recyclerView = (RecyclerView) View.inflate(new ContextThemeWrapper(getContext(), themeRes),
|
||||
R.layout.favourites_recycleview, null);
|
||||
R.layout.recyclerview, null);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
location = getMyApplication().getLocationProvider().getLastKnownLocation();
|
||||
if (location != null) {
|
||||
|
@ -72,8 +72,8 @@ public class FavouritesBottomSheetMenuFragment extends MenuBottomSheetDialogFrag
|
|||
}
|
||||
adapter = new FavouritesAdapter(getContext(), favouritePoints);
|
||||
sortFavourites();
|
||||
final BottomSheetItemWithTitleAndButton[] title = new BottomSheetItemWithTitleAndButton[1];
|
||||
title[0] = (BottomSheetItemWithTitleAndButton) new BottomSheetItemWithTitleAndButton.Builder()
|
||||
final BottomSheetItemTitleWithDescrAndButton[] title = new BottomSheetItemTitleWithDescrAndButton[1];
|
||||
title[0] = (BottomSheetItemTitleWithDescrAndButton) new BottomSheetItemTitleWithDescrAndButton.Builder()
|
||||
.setButtonIcons(null, getIconForButton())
|
||||
.setButtonTitle(getTextForButton(sortByDist))
|
||||
.setonButtonClickListener(new View.OnClickListener() {
|
||||
|
@ -87,7 +87,7 @@ public class FavouritesBottomSheetMenuFragment extends MenuBottomSheetDialogFrag
|
|||
})
|
||||
.setDescription(getTextForButton(!sortByDist))
|
||||
.setTitle(getString(R.string.favourites))
|
||||
.setLayoutId(R.layout.bottom_sheet_item_with_title_and_button)
|
||||
.setLayoutId(R.layout.bottom_sheet_item_title_with_descr_and_button)
|
||||
.create();
|
||||
items.add(title[0]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue