Long press the Floating Action Button to see more options.

This commit is contained in:
Alex Ning 2020-09-27 17:06:55 +08:00
parent 62a457a868
commit ca19c566c3
30 changed files with 349 additions and 33 deletions

View File

@ -67,6 +67,7 @@ import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask
import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubscribedThingsAsyncTask; import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubscribedThingsAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask; import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchToAnonymousAccountAsyncTask; import ml.docilealligator.infinityforreddit.AsyncTask.SwitchToAnonymousAccountAsyncTask;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.FABMoreOptionsBottomSheetFragment;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.PostLayoutBottomSheetFragment; import ml.docilealligator.infinityforreddit.BottomSheetFragment.PostLayoutBottomSheetFragment;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.PostTypeBottomSheetFragment; import ml.docilealligator.infinityforreddit.BottomSheetFragment.PostTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.SortTimeBottomSheetFragment; import ml.docilealligator.infinityforreddit.BottomSheetFragment.SortTimeBottomSheetFragment;
@ -104,7 +105,7 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public class MainActivity extends BaseActivity implements SortTypeSelectionCallback, public class MainActivity extends BaseActivity implements SortTypeSelectionCallback,
PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback,
ActivityToolbarInterface { ActivityToolbarInterface, FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback {
static final String EXTRA_POST_TYPE = "EPT"; static final String EXTRA_POST_TYPE = "EPT";
static final String EXTRA_MESSSAGE_FULLNAME = "ENF"; static final String EXTRA_MESSSAGE_FULLNAME = "ENF";
@ -191,6 +192,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
private SortTypeBottomSheetFragment sortTypeBottomSheetFragment; private SortTypeBottomSheetFragment sortTypeBottomSheetFragment;
private SortTimeBottomSheetFragment sortTimeBottomSheetFragment; private SortTimeBottomSheetFragment sortTimeBottomSheetFragment;
private PostLayoutBottomSheetFragment postLayoutBottomSheetFragment; private PostLayoutBottomSheetFragment postLayoutBottomSheetFragment;
private FABMoreOptionsBottomSheetFragment fabMoreOptionsBottomSheetFragment;
private NavigationDrawerRecyclerViewAdapter adapter; private NavigationDrawerRecyclerViewAdapter adapter;
private boolean mNullAccessToken = false; private boolean mNullAccessToken = false;
private String mAccessToken; private String mAccessToken;
@ -264,6 +266,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
sortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); sortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
sortTimeBottomSheetFragment = new SortTimeBottomSheetFragment(); sortTimeBottomSheetFragment = new SortTimeBottomSheetFragment();
postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment(); postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment();
fabMoreOptionsBottomSheetFragment = new FABMoreOptionsBottomSheetFragment();
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
setToolbarGoToTop(toolbar); setToolbarGoToTop(toolbar);
@ -555,13 +558,13 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
int fabOption = bottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS); int fabOption = bottomAppBarSharedPreference.getInt(SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB, SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS);
switch (fabOption) { switch (fabOption) {
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_REFRESH: case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_REFRESH:
fab.setImageResource(R.drawable.ic_refresh_black_24dp); fab.setImageResource(R.drawable.ic_refresh_24dp);
break; break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE: case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE:
fab.setImageResource(R.drawable.ic_sort_toolbar_24dp); fab.setImageResource(R.drawable.ic_sort_24dp);
break; break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_CHANGE_POST_LAYOUT: case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_CHANGE_POST_LAYOUT:
fab.setImageResource(R.drawable.ic_post_layout_black_24dp); fab.setImageResource(R.drawable.ic_post_layout_24dp);
break; break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_SEARCH: case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_SEARCH:
fab.setImageResource(R.drawable.ic_search_black_24dp); fab.setImageResource(R.drawable.ic_search_black_24dp);
@ -596,6 +599,10 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
break; break;
} }
}); });
fab.setOnLongClickListener(view -> {
fabMoreOptionsBottomSheetFragment.show(getSupportFragmentManager(), fabMoreOptionsBottomSheetFragment.getTag());
return true;
});
fab.setVisibility(View.VISIBLE); fab.setVisibility(View.VISIBLE);
} }
@ -1130,6 +1137,30 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
} }
} }
@Override
public void fabOptionSelected(int option) {
switch (option) {
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_SUBMIT_POST:
postTypeBottomSheetFragment.show(getSupportFragmentManager(), postTypeBottomSheetFragment.getTag());
break;
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_REFRESH:
if (sectionsPagerAdapter != null) {
sectionsPagerAdapter.refresh();
}
break;
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_CHANGE_SORT_TYPE:
changeSortType();
break;
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_CHANGE_POST_LAYOUT:
postLayoutBottomSheetFragment.show(getSupportFragmentManager(), postLayoutBottomSheetFragment.getTag());
break;
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_SEARCH:
Intent intent = new Intent(this, SearchActivity.class);
startActivity(intent);
break;
}
}
private class SectionsPagerAdapter extends FragmentStateAdapter { private class SectionsPagerAdapter extends FragmentStateAdapter {
int tabCount; int tabCount;
boolean showFavoriteSubscribedSubreddits; boolean showFavoriteSubscribedSubreddits;

View File

@ -60,6 +60,7 @@ import ml.docilealligator.infinityforreddit.AsyncTask.CheckIsSubscribedToSubredd
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask; import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubredditDataAsyncTask; import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubredditDataAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask; import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.FABMoreOptionsBottomSheetFragment;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.PostLayoutBottomSheetFragment; import ml.docilealligator.infinityforreddit.BottomSheetFragment.PostLayoutBottomSheetFragment;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.PostTypeBottomSheetFragment; import ml.docilealligator.infinityforreddit.BottomSheetFragment.PostTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.BottomSheetFragment.SortTimeBottomSheetFragment; import ml.docilealligator.infinityforreddit.BottomSheetFragment.SortTimeBottomSheetFragment;
@ -89,7 +90,7 @@ import retrofit2.Retrofit;
public class ViewSubredditDetailActivity extends BaseActivity implements SortTypeSelectionCallback, public class ViewSubredditDetailActivity extends BaseActivity implements SortTypeSelectionCallback,
PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback,
ActivityToolbarInterface { ActivityToolbarInterface, FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback {
public static final String EXTRA_SUBREDDIT_NAME_KEY = "ESN"; public static final String EXTRA_SUBREDDIT_NAME_KEY = "ESN";
public static final String EXTRA_MESSAGE_FULLNAME = "ENF"; public static final String EXTRA_MESSAGE_FULLNAME = "ENF";
@ -196,6 +197,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
private SortTypeBottomSheetFragment sortTypeBottomSheetFragment; private SortTypeBottomSheetFragment sortTypeBottomSheetFragment;
private SortTimeBottomSheetFragment sortTimeBottomSheetFragment; private SortTimeBottomSheetFragment sortTimeBottomSheetFragment;
private PostLayoutBottomSheetFragment postLayoutBottomSheetFragment; private PostLayoutBottomSheetFragment postLayoutBottomSheetFragment;
private FABMoreOptionsBottomSheetFragment fabMoreOptionsBottomSheetFragment;
private int expandedTabTextColor; private int expandedTabTextColor;
private int expandedTabBackgroundColor; private int expandedTabBackgroundColor;
private int expandedTabIndicatorColor; private int expandedTabIndicatorColor;
@ -341,8 +343,8 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
sortTypeBottomSheetFragment.setArguments(bottomSheetBundle); sortTypeBottomSheetFragment.setArguments(bottomSheetBundle);
sortTimeBottomSheetFragment = new SortTimeBottomSheetFragment(); sortTimeBottomSheetFragment = new SortTimeBottomSheetFragment();
postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment(); postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment();
fabMoreOptionsBottomSheetFragment = new FABMoreOptionsBottomSheetFragment();
params = (AppBarLayout.LayoutParams) collapsingToolbarLayout.getLayoutParams(); params = (AppBarLayout.LayoutParams) collapsingToolbarLayout.getLayoutParams();
@ -643,13 +645,13 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
int fabOption = bottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS); int fabOption = bottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS);
switch (fabOption) { switch (fabOption) {
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH: case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH:
fab.setImageResource(R.drawable.ic_refresh_black_24dp); fab.setImageResource(R.drawable.ic_refresh_24dp);
break; break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE: case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE:
fab.setImageResource(R.drawable.ic_sort_toolbar_24dp); fab.setImageResource(R.drawable.ic_sort_24dp);
break; break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_POST_LAYOUT: case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_POST_LAYOUT:
fab.setImageResource(R.drawable.ic_post_layout_black_24dp); fab.setImageResource(R.drawable.ic_post_layout_24dp);
break; break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SEARCH: case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SEARCH:
fab.setImageResource(R.drawable.ic_search_black_24dp); fab.setImageResource(R.drawable.ic_search_black_24dp);
@ -685,6 +687,10 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
break; break;
} }
}); });
fab.setOnLongClickListener(view -> {
fabMoreOptionsBottomSheetFragment.show(getSupportFragmentManager(), fabMoreOptionsBottomSheetFragment.getTag());
return true;
});
fab.setVisibility(View.VISIBLE); fab.setVisibility(View.VISIBLE);
} else { } else {
@ -1017,9 +1023,32 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
} }
} }
@Override
public void fabOptionSelected(int option) {
switch (option) {
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_SUBMIT_POST:
postTypeBottomSheetFragment.show(getSupportFragmentManager(), postTypeBottomSheetFragment.getTag());
break;
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_REFRESH:
if (sectionsPagerAdapter != null) {
sectionsPagerAdapter.refresh();
}
break;
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_CHANGE_SORT_TYPE:
sortTypeBottomSheetFragment.show(getSupportFragmentManager(), sortTypeBottomSheetFragment.getTag());
break;
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_CHANGE_POST_LAYOUT:
postLayoutBottomSheetFragment.show(getSupportFragmentManager(), postLayoutBottomSheetFragment.getTag());
break;
case FABMoreOptionsBottomSheetFragment.FAB_OPTION_SEARCH:
Intent intent = new Intent(this, SearchActivity.class);
intent.putExtra(SearchActivity.EXTRA_SUBREDDIT_NAME, subredditName);
startActivity(intent);
break;
}
}
private class SectionsPagerAdapter extends FragmentStateAdapter { private class SectionsPagerAdapter extends FragmentStateAdapter {
/*private PostFragment postFragment;
private SidebarFragment sidebarFragment;*/
SectionsPagerAdapter(FragmentManager fm, Lifecycle lifecycle) { SectionsPagerAdapter(FragmentManager fm, Lifecycle lifecycle) {
super(fm, lifecycle); super(fm, lifecycle);

View File

@ -0,0 +1,87 @@
package ml.docilealligator.infinityforreddit.BottomSheetFragment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.R;
public class FABMoreOptionsBottomSheetFragment extends RoundedBottomSheetDialogFragment {
public static final int FAB_OPTION_SUBMIT_POST = 0;
public static final int FAB_OPTION_REFRESH = 1;
public static final int FAB_OPTION_CHANGE_SORT_TYPE = 2;
public static final int FAB_OPTION_CHANGE_POST_LAYOUT = 3;
public static final int FAB_OPTION_SEARCH = 4;
@BindView(R.id.submit_post_text_view_fab_more_options_bottom_sheet_fragment)
TextView submitPostTextView;
@BindView(R.id.refresh_text_view_fab_more_options_bottom_sheet_fragment)
TextView refreshTextView;
@BindView(R.id.change_sort_type_text_view_fab_more_options_bottom_sheet_fragment)
TextView changeSortTypeTextView;
@BindView(R.id.change_post_layout_text_view_fab_more_options_bottom_sheet_fragment)
TextView changePostLayoutTextView;
@BindView(R.id.search_text_view_fab_more_options_bottom_sheet_fragment)
TextView searchTextView;
private FABOptionSelectionCallback activity;
public FABMoreOptionsBottomSheetFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_fab_more_options_bottom_sheet, container, false);
ButterKnife.bind(this, rootView);
submitPostTextView.setOnClickListener(view -> {
activity.fabOptionSelected(FAB_OPTION_SUBMIT_POST);
dismiss();
});
refreshTextView.setOnClickListener(view -> {
activity.fabOptionSelected(FAB_OPTION_REFRESH);
dismiss();
});
changeSortTypeTextView.setOnClickListener(view -> {
activity.fabOptionSelected(FAB_OPTION_CHANGE_SORT_TYPE);
dismiss();
});
changePostLayoutTextView.setOnClickListener(view -> {
activity.fabOptionSelected(FAB_OPTION_CHANGE_POST_LAYOUT);
dismiss();
});
searchTextView.setOnClickListener(view -> {
activity.fabOptionSelected(FAB_OPTION_SEARCH);
dismiss();
});
return rootView;
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
this.activity = (FABOptionSelectionCallback) context;
}
public interface FABOptionSelectionCallback {
void fabOptionSelected(int option);
}
}

View File

@ -39,6 +39,7 @@ public class PostTypeBottomSheetFragment extends RoundedBottomSheetDialogFragmen
@BindView(R.id.video_type_linear_layout_post_type_bottom_sheet_fragment) @BindView(R.id.video_type_linear_layout_post_type_bottom_sheet_fragment)
TextView videoTypeTextView; TextView videoTypeTextView;
private Activity activity; private Activity activity;
public PostTypeBottomSheetFragment() { public PostTypeBottomSheetFragment() {
// Required empty public constructor // Required empty public constructor
} }

View File

@ -46,9 +46,7 @@ public class Infinity extends Application {
EventBus.builder().addIndex(new EventBusIndex()).installDefaultEventBus(); EventBus.builder().addIndex(new EventBusIndex()).installDefaultEventBus();
mNetworkWifiStatusReceiver = mNetworkWifiStatusReceiver =
new NetworkWifiStatusReceiver(() -> { new NetworkWifiStatusReceiver(() -> EventBus.getDefault().post(new ChangeNetworkStatusEvent(Utils.getConnectedNetwork(getApplicationContext()))));
EventBus.getDefault().post(new ChangeNetworkStatusEvent(Utils.getConnectedNetwork(getApplicationContext())));
});
registerReceiver(mNetworkWifiStatusReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); registerReceiver(mNetworkWifiStatusReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
} }

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,5v14h19L22,5L3,5zM5,7h15v4L5,11L5,7zM5,17v-4h4v4L5,17zM11,17v-4h9v4h-9z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#000000" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M3,18h6v-2L3,16v2zM3,6v2h18L21,6L3,6zM3,13h12v-2L3,11v2z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"
android:fillColor="#000000"/>
</vector>

View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".BottomSheetFragment.FABMoreOptionsBottomSheetFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/submit_post_text_view_fab_more_options_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/submit_post"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
app:drawableStartCompat="@drawable/ic_submit_post_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/refresh_text_view_fab_more_options_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/refresh"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
app:drawableStartCompat="@drawable/ic_refresh_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/change_sort_type_text_view_fab_more_options_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/change_sort_type"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
app:drawableStartCompat="@drawable/ic_sort_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/change_post_layout_text_view_fab_more_options_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/change_post_layout"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
app:drawableStartCompat="@drawable/ic_post_layout_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/search_text_view_fab_more_options_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/search"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
app:drawableStartCompat="@drawable/ic_search_24dp"
android:drawablePadding="48dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -23,7 +23,7 @@
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default" android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" android:fontFamily="?attr/font_family"
android:drawableStart="@drawable/ic_outline_text_24px" android:drawableStart="@drawable/ic_text_24dp"
android:drawablePadding="48dp" android:drawablePadding="48dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"

View File

@ -5,14 +5,14 @@
android:id="@+id/action_sort_filtered_thing_activity" android:id="@+id/action_sort_filtered_thing_activity"
android:orderInCategory="1" android:orderInCategory="1"
android:title="@string/action_sort" android:title="@string/action_sort"
android:icon="@drawable/ic_sort_toolbar_24dp" android:icon="@drawable/ic_sort_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_refresh_filtered_thing_activity" android:id="@+id/action_refresh_filtered_thing_activity"
android:orderInCategory="2" android:orderInCategory="2"
android:title="@string/action_refresh" android:title="@string/action_refresh"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item

View File

@ -8,14 +8,14 @@
android:id="@+id/action_search_main_activity" android:id="@+id/action_search_main_activity"
android:orderInCategory="1" android:orderInCategory="1"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_sort_main_activity" android:id="@+id/action_sort_main_activity"
android:orderInCategory="2" android:orderInCategory="2"
android:title="@string/action_sort" android:title="@string/action_sort"
android:icon="@drawable/ic_sort_toolbar_24dp" android:icon="@drawable/ic_sort_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item

View File

@ -7,6 +7,6 @@
android:id="@+id/action_search_search_activity" android:id="@+id/action_search_search_activity"
android:orderInCategory="1" android:orderInCategory="1"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
</menu> </menu>

View File

@ -5,14 +5,14 @@
android:id="@+id/action_sort_search_result_activity" android:id="@+id/action_sort_search_result_activity"
android:orderInCategory="1" android:orderInCategory="1"
android:title="@string/action_sort" android:title="@string/action_sort"
android:icon="@drawable/ic_sort_toolbar_24dp" android:icon="@drawable/ic_sort_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_search_search_result_activity" android:id="@+id/action_search_search_result_activity"
android:orderInCategory="2" android:orderInCategory="2"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item

View File

@ -12,6 +12,6 @@
android:id="@+id/action_search_subreddit_multiselection_activity" android:id="@+id/action_search_subreddit_multiselection_activity"
android:orderInCategory="2" android:orderInCategory="2"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
</menu> </menu>

View File

@ -5,6 +5,6 @@
android:id="@+id/action_search_subreddit_selection_activity" android:id="@+id/action_search_subreddit_selection_activity"
android:orderInCategory="1" android:orderInCategory="1"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
</menu> </menu>

View File

@ -7,14 +7,14 @@
android:id="@+id/action_sort_view_multi_reddit_detail_activity" android:id="@+id/action_sort_view_multi_reddit_detail_activity"
android:orderInCategory="1" android:orderInCategory="1"
android:title="@string/action_sort" android:title="@string/action_sort"
android:icon="@drawable/ic_sort_toolbar_24dp" android:icon="@drawable/ic_sort_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_search_view_multi_reddit_detail_activity" android:id="@+id/action_search_view_multi_reddit_detail_activity"
android:orderInCategory="2" android:orderInCategory="2"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_refresh_view_multi_reddit_detail_activity" android:id="@+id/action_refresh_view_multi_reddit_detail_activity"

View File

@ -7,14 +7,14 @@
android:id="@+id/action_sort_view_subreddit_detail_activity" android:id="@+id/action_sort_view_subreddit_detail_activity"
android:orderInCategory="1" android:orderInCategory="1"
android:title="@string/action_sort" android:title="@string/action_sort"
android:icon="@drawable/ic_sort_toolbar_24dp" android:icon="@drawable/ic_sort_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_search_view_subreddit_detail_activity" android:id="@+id/action_search_view_subreddit_detail_activity"
android:orderInCategory="2" android:orderInCategory="2"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_refresh_view_subreddit_detail_activity" android:id="@+id/action_refresh_view_subreddit_detail_activity"

View File

@ -6,13 +6,13 @@
android:id="@+id/action_sort_view_user_detail_activity" android:id="@+id/action_sort_view_user_detail_activity"
android:orderInCategory="1" android:orderInCategory="1"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_sort_toolbar_24dp" android:icon="@drawable/ic_sort_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_search_view_user_detail_activity" android:id="@+id/action_search_view_user_detail_activity"
android:orderInCategory="2" android:orderInCategory="2"
android:title="@string/action_search" android:title="@string/action_search"
android:icon="@drawable/ic_search_toolbar_24dp" android:icon="@drawable/ic_search_24dp"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_refresh_view_user_detail_activity" android:id="@+id/action_refresh_view_user_detail_activity"

View File

@ -468,7 +468,7 @@
<string name="settings_video_download_location_title">Video Download Location</string> <string name="settings_video_download_location_title">Video Download Location</string>
<string name="settings_separate_folder_for_each_subreddit">Separate Folder for Each Subreddit</string> <string name="settings_separate_folder_for_each_subreddit">Separate Folder for Each Subreddit</string>
<string name="settings_swipe_action_title">Swipe Action</string> <string name="settings_swipe_action_title">Swipe Action</string>
<string name="settings_vibrate_when_action_triggered_title">Vibrate the phone when the action is triggered</string> <string name="settings_vibrate_when_action_triggered_title">Vibrate the phone when an action is triggered</string>
<string name="settings_disable_swiping_between_tabs_title">Disable Swiping Between Tabs</string> <string name="settings_disable_swiping_between_tabs_title">Disable Swiping Between Tabs</string>
<string name="settings_enable_swipe_action_title">Enable Swipe Action</string> <string name="settings_enable_swipe_action_title">Enable Swipe Action</string>
<string name="settings_swipe_action_threshold">Threshold</string> <string name="settings_swipe_action_threshold">Threshold</string>
@ -487,6 +487,7 @@
<string name="settings_bottom_app_bar_option_4">Option 4</string> <string name="settings_bottom_app_bar_option_4">Option 4</string>
<string name="settings_bottom_app_bar_fab">Floating Action Button</string> <string name="settings_bottom_app_bar_fab">Floating Action Button</string>
<string name="settings_data_saving_mode">Data Saving Mode</string> <string name="settings_data_saving_mode">Data Saving Mode</string>
<string name="settings_data_saving_mode_info_summary">In data saving mode, preview images are in lower resolution.</string>
<string name="no_link_available">Cannot get the link</string> <string name="no_link_available">Cannot get the link</string>
@ -893,7 +894,10 @@
<string name="unlock_account_section">Unlock Account Section</string> <string name="unlock_account_section">Unlock Account Section</string>
<string name="unlock">Unlock</string> <string name="unlock">Unlock</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string> <string name="submit_post">Submit Post</string>
<string name="refresh">Refresh</string>
<string name="change_sort_type">Change Sort Type</string>
<string name="change_post_layout">Change Post Layout</string>
</resources> </resources>

View File

@ -10,4 +10,9 @@
app:entryValues="@array/settings_data_saving_mode_values" app:entryValues="@array/settings_data_saving_mode_values"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<Preference
app:icon="@drawable/ic_info_preference_24dp"
app:summary="@string/settings_data_saving_mode_info_summary"
app:enabled="false" />
</PreferenceScreen> </PreferenceScreen>