From 2bc75b5c06ca3a82aa66f893b3bb009683637a6f Mon Sep 17 00:00:00 2001 From: stom79 Date: Sat, 17 Feb 2018 15:28:15 +0100 Subject: [PATCH] Some fixes --- .../mastodon/activities/OwnerStatusActivity.java | 15 ++++++++------- app/src/main/res/layout/activity_ower_status.xml | 16 ++++++++++++++++ app/src/main/res/layout/filter_owner_toots.xml | 4 ++-- app/src/main/res/values/strings.xml | 3 +++ 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/OwnerStatusActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/OwnerStatusActivity.java index 76669e18e..ce1172dd2 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/OwnerStatusActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/OwnerStatusActivity.java @@ -78,9 +78,6 @@ import fr.gouv.etalab.mastodon.sqlite.StatusCacheDAO; public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeedsInterface { - private TextView toolbarTitle; - private RecyclerView lv_status; - private boolean isRefreshed; private ImageView pp_actionBar; private StatusListAdapter statusListAdapter; private SharedPreferences sharedpreferences; @@ -130,12 +127,12 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds finish(); } }); - toolbarTitle = actionBar.getCustomView().findViewById(R.id.toolbar_title); + TextView toolbarTitle = actionBar.getCustomView().findViewById(R.id.toolbar_title); pp_actionBar = actionBar.getCustomView().findViewById(R.id.pp_actionBar); toolbarTitle.setText(getString(R.string.owner_cached_toots)); } statuses = new ArrayList<>(); - lv_status = findViewById(R.id.lv_status); + RecyclerView lv_status = findViewById(R.id.lv_status); mainLoader = findViewById(R.id.loader); nextElementLoader = findViewById(R.id.loading_next_status); textviewNoAction = findViewById(R.id.no_action); @@ -185,8 +182,6 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds } }); - isRefreshed = false; - swipeRefreshLayout = findViewById(R.id.swipeContainer); new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4, @@ -346,6 +341,9 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds .setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { + RelativeLayout no_result = findViewById(R.id.no_result); + no_result.setVisibility(View.GONE); + filterToots.setBoosts(FilterToots.typeFilter.values()[filter_boost.getSelectedItemPosition()]); filterToots.setReplies(FilterToots.typeFilter.values()[filter_replies.getSelectedItemPosition()]); filterToots.setMedia(FilterToots.typeFilter.values()[filter_media.getSelectedItemPosition()]); @@ -422,6 +420,9 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds if( statuses != null && statuses.size() > 0) { this.statuses.addAll(statuses); statusListAdapter.notifyItemRangeInserted(previousPosition, statuses.size()); + }else { + RelativeLayout no_result = findViewById(R.id.no_result); + no_result.setVisibility(View.VISIBLE); } swipeRefreshLayout.setRefreshing(false); firstLoad = false; diff --git a/app/src/main/res/layout/activity_ower_status.xml b/app/src/main/res/layout/activity_ower_status.xml index c8cb5b187..16766a877 100644 --- a/app/src/main/res/layout/activity_ower_status.xml +++ b/app/src/main/res/layout/activity_ower_status.xml @@ -67,6 +67,22 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> + + + + android:text="@string/show_media"/> + android:text="@string/show_pinned"/> Private Direct Some keywords… + Show media + Show pinned + No matching result found! No Only