Fix #4758
This commit is contained in:
parent
345b977996
commit
ac78d7a38e
2 changed files with 24 additions and 14 deletions
|
@ -167,12 +167,16 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
ImageView emptyImageView = (ImageView) emptyView.findViewById(R.id.empty_state_image_view);
|
||||
emptyImageView.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_empty_state_favorites_day : R.drawable.ic_empty_state_favorites_night);
|
||||
Button importButton = (Button) emptyView.findViewById(R.id.import_button);
|
||||
importButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
importFavourites();
|
||||
}
|
||||
});
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
importButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
importFavourites();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
importButton.setVisibility(View.GONE);
|
||||
}
|
||||
listView.setEmptyView(emptyView);
|
||||
listView.setAdapter(favouritesAdapter);
|
||||
setListView(listView);
|
||||
|
@ -321,8 +325,10 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
|
||||
|
||||
if (!MenuItemCompat.isActionViewExpanded(mi)) {
|
||||
createMenuItem(menu, IMPORT_FAVOURITES_ID, R.string.shared_string_add_to_favorites, R.drawable.ic_action_plus,
|
||||
R.drawable.ic_action_plus, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
createMenuItem(menu, IMPORT_FAVOURITES_ID, R.string.shared_string_add_to_favorites, R.drawable.ic_action_plus,
|
||||
R.drawable.ic_action_plus, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||
}
|
||||
createMenuItem(menu, SHARE_ID, R.string.shared_string_share, R.drawable.ic_action_gshare_dark,
|
||||
R.drawable.ic_action_gshare_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||
if (getSettings().USE_MAP_MARKERS.get()) {
|
||||
|
|
|
@ -332,12 +332,16 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
ImageView emptyImageView = (ImageView) emptyView.findViewById(R.id.empty_state_image_view);
|
||||
emptyImageView.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_empty_state_trip_day : R.drawable.ic_empty_state_trip_night);
|
||||
Button importButton = (Button) emptyView.findViewById(R.id.import_button);
|
||||
importButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
addTrack();
|
||||
}
|
||||
});
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
importButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
addTrack();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
importButton.setVisibility(View.GONE);
|
||||
}
|
||||
if (this.adapter != null) {
|
||||
listView.setAdapter(this.adapter);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue