Some fixes
This commit is contained in:
parent
a1aa96a2bd
commit
2bc75b5c06
|
@ -78,9 +78,6 @@ import fr.gouv.etalab.mastodon.sqlite.StatusCacheDAO;
|
||||||
public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeedsInterface {
|
public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeedsInterface {
|
||||||
|
|
||||||
|
|
||||||
private TextView toolbarTitle;
|
|
||||||
private RecyclerView lv_status;
|
|
||||||
private boolean isRefreshed;
|
|
||||||
private ImageView pp_actionBar;
|
private ImageView pp_actionBar;
|
||||||
private StatusListAdapter statusListAdapter;
|
private StatusListAdapter statusListAdapter;
|
||||||
private SharedPreferences sharedpreferences;
|
private SharedPreferences sharedpreferences;
|
||||||
|
@ -130,12 +127,12 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
|
||||||
finish();
|
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);
|
pp_actionBar = actionBar.getCustomView().findViewById(R.id.pp_actionBar);
|
||||||
toolbarTitle.setText(getString(R.string.owner_cached_toots));
|
toolbarTitle.setText(getString(R.string.owner_cached_toots));
|
||||||
}
|
}
|
||||||
statuses = new ArrayList<>();
|
statuses = new ArrayList<>();
|
||||||
lv_status = findViewById(R.id.lv_status);
|
RecyclerView lv_status = findViewById(R.id.lv_status);
|
||||||
mainLoader = findViewById(R.id.loader);
|
mainLoader = findViewById(R.id.loader);
|
||||||
nextElementLoader = findViewById(R.id.loading_next_status);
|
nextElementLoader = findViewById(R.id.loading_next_status);
|
||||||
textviewNoAction = findViewById(R.id.no_action);
|
textviewNoAction = findViewById(R.id.no_action);
|
||||||
|
@ -185,8 +182,6 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
isRefreshed = false;
|
|
||||||
|
|
||||||
swipeRefreshLayout = findViewById(R.id.swipeContainer);
|
swipeRefreshLayout = findViewById(R.id.swipeContainer);
|
||||||
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
|
swipeRefreshLayout.setColorSchemeResources(R.color.mastodonC4,
|
||||||
|
@ -346,6 +341,9 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
|
||||||
.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
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.setBoosts(FilterToots.typeFilter.values()[filter_boost.getSelectedItemPosition()]);
|
||||||
filterToots.setReplies(FilterToots.typeFilter.values()[filter_replies.getSelectedItemPosition()]);
|
filterToots.setReplies(FilterToots.typeFilter.values()[filter_replies.getSelectedItemPosition()]);
|
||||||
filterToots.setMedia(FilterToots.typeFilter.values()[filter_media.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) {
|
if( statuses != null && statuses.size() > 0) {
|
||||||
this.statuses.addAll(statuses);
|
this.statuses.addAll(statuses);
|
||||||
statusListAdapter.notifyItemRangeInserted(previousPosition, statuses.size());
|
statusListAdapter.notifyItemRangeInserted(previousPosition, statuses.size());
|
||||||
|
}else {
|
||||||
|
RelativeLayout no_result = findViewById(R.id.no_result);
|
||||||
|
no_result.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
firstLoad = false;
|
firstLoad = false;
|
||||||
|
|
|
@ -67,6 +67,22 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/no_result"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:padding="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="25sp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:textStyle="italic|bold"
|
||||||
|
android:typeface="serif"
|
||||||
|
android:text="@string/filter_no_result"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</RelativeLayout>
|
||||||
<!-- Main Loader -->
|
<!-- Main Loader -->
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/loader"
|
android:id="@+id/loader"
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/media"/>
|
android:text="@string/show_media"/>
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/filter_media"
|
android:id="@+id/filter_media"
|
||||||
android:entries="@array/filter_select"
|
android:entries="@array/filter_select"
|
||||||
|
@ -156,7 +156,7 @@
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/pinned_toots"/>
|
android:text="@string/show_pinned"/>
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/filter_pinned"
|
android:id="@+id/filter_pinned"
|
||||||
android:entries="@array/filter_select"
|
android:entries="@array/filter_select"
|
||||||
|
|
|
@ -406,6 +406,9 @@
|
||||||
<string name="v_private">Private</string>
|
<string name="v_private">Private</string>
|
||||||
<string name="v_direct">Direct</string>
|
<string name="v_direct">Direct</string>
|
||||||
<string name="v_keywords">Some keywords…</string>
|
<string name="v_keywords">Some keywords…</string>
|
||||||
|
<string name="show_media">Show media</string>
|
||||||
|
<string name="show_pinned">Show pinned</string>
|
||||||
|
<string name="filter_no_result">No matching result found!</string>
|
||||||
<string-array name="filter_select">
|
<string-array name="filter_select">
|
||||||
<item>No</item>
|
<item>No</item>
|
||||||
<item>Only</item>
|
<item>Only</item>
|
||||||
|
|
Loading…
Reference in New Issue