Adding users to a multireddit is now available.

This commit is contained in:
Alex Ning 2021-01-05 23:17:56 +08:00
parent f2fbebd434
commit 68b1c6a7f4
25 changed files with 238 additions and 91 deletions

View File

@ -117,7 +117,7 @@
android:parentActivityName=".activities.MainActivity" android:parentActivityName=".activities.MainActivity"
android:theme="@style/AppTheme.Slidable" /> android:theme="@style/AppTheme.Slidable" />
<activity <activity
android:name=".activities.SelectedSubredditsActivity" android:name=".activities.SelectedSubredditsAndUsersActivity"
android:label="@string/selected_subeddits_activity_label" android:label="@string/selected_subeddits_activity_label"
android:parentActivityName=".activities.MainActivity" android:parentActivityName=".activities.MainActivity"
android:theme="@style/AppTheme.Slidable" /> android:theme="@style/AppTheme.Slidable" />

View File

@ -36,7 +36,7 @@ import ml.docilealligator.infinityforreddit.activities.SearchResultActivity;
import ml.docilealligator.infinityforreddit.activities.SearchSubredditsResultActivity; import ml.docilealligator.infinityforreddit.activities.SearchSubredditsResultActivity;
import ml.docilealligator.infinityforreddit.activities.SearchUsersResultActivity; import ml.docilealligator.infinityforreddit.activities.SearchUsersResultActivity;
import ml.docilealligator.infinityforreddit.activities.SelectUserFlairActivity; import ml.docilealligator.infinityforreddit.activities.SelectUserFlairActivity;
import ml.docilealligator.infinityforreddit.activities.SelectedSubredditsActivity; import ml.docilealligator.infinityforreddit.activities.SelectedSubredditsAndUsersActivity;
import ml.docilealligator.infinityforreddit.activities.SendPrivateMessageActivity; import ml.docilealligator.infinityforreddit.activities.SendPrivateMessageActivity;
import ml.docilealligator.infinityforreddit.activities.SettingsActivity; import ml.docilealligator.infinityforreddit.activities.SettingsActivity;
import ml.docilealligator.infinityforreddit.activities.SubmitCrosspostActivity; import ml.docilealligator.infinityforreddit.activities.SubmitCrosspostActivity;
@ -181,7 +181,7 @@ public interface AppComponent {
void inject(EditMultiRedditActivity editMultiRedditActivity); void inject(EditMultiRedditActivity editMultiRedditActivity);
void inject(SelectedSubredditsActivity selectedSubredditsActivity); void inject(SelectedSubredditsAndUsersActivity selectedSubredditsAndUsersActivity);
void inject(ReportActivity reportActivity); void inject(ReportActivity reportActivity);

View File

@ -144,8 +144,8 @@ public class CreateMultiRedditActivity extends BaseActivity {
private void bindView() { private void bindView() {
selectSubredditTextView.setOnClickListener(view -> { selectSubredditTextView.setOnClickListener(view -> {
Intent intent = new Intent(CreateMultiRedditActivity.this, SelectedSubredditsActivity.class); Intent intent = new Intent(CreateMultiRedditActivity.this, SelectedSubredditsAndUsersActivity.class);
intent.putStringArrayListExtra(SelectedSubredditsActivity.EXTRA_SELECTED_SUBREDDITS, mSubreddits); intent.putStringArrayListExtra(SelectedSubredditsAndUsersActivity.EXTRA_SELECTED_SUBREDDITS, mSubreddits);
startActivityForResult(intent, SUBREDDIT_SELECTION_REQUEST_CODE); startActivityForResult(intent, SUBREDDIT_SELECTION_REQUEST_CODE);
}); });
} }

View File

@ -179,9 +179,9 @@ public class EditMultiRedditActivity extends BaseActivity {
} }
selectSubredditTextView.setOnClickListener(view -> { selectSubredditTextView.setOnClickListener(view -> {
Intent intent = new Intent(EditMultiRedditActivity.this, SelectedSubredditsActivity.class); Intent intent = new Intent(EditMultiRedditActivity.this, SelectedSubredditsAndUsersActivity.class);
if (multiReddit.getSubreddits() != null) { if (multiReddit.getSubreddits() != null) {
intent.putStringArrayListExtra(SelectedSubredditsActivity.EXTRA_SELECTED_SUBREDDITS, multiReddit.getSubreddits()); intent.putStringArrayListExtra(SelectedSubredditsAndUsersActivity.EXTRA_SELECTED_SUBREDDITS, multiReddit.getSubreddits());
} }
startActivityForResult(intent, SUBREDDIT_SELECTION_REQUEST_CODE); startActivityForResult(intent, SUBREDDIT_SELECTION_REQUEST_CODE);
}); });
@ -196,11 +196,11 @@ public class EditMultiRedditActivity extends BaseActivity {
@Override @Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) { public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) { int itemId = item.getItemId();
case android.R.id.home: if (itemId == android.R.id.home) {
finish(); finish();
return true; return true;
case R.id.action_save_edit_multi_reddit_activity: } else if (itemId == R.id.action_save_edit_multi_reddit_activity) {
if (mAccountName == null || mAccessToken == null) { if (mAccountName == null || mAccessToken == null) {
Snackbar.make(coordinatorLayout, R.string.something_went_wrong, Snackbar.LENGTH_SHORT).show(); Snackbar.make(coordinatorLayout, R.string.something_went_wrong, Snackbar.LENGTH_SHORT).show();
return true; return true;
@ -234,7 +234,7 @@ public class EditMultiRedditActivity extends BaseActivity {
if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE && resultCode == RESULT_OK) { if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE && resultCode == RESULT_OK) {
if (data != null) { if (data != null) {
multiReddit.setSubreddits(data.getStringArrayListExtra( multiReddit.setSubreddits(data.getStringArrayListExtra(
SelectedSubredditsActivity.EXTRA_RETURN_SELECTED_SUBREDDITS)); SelectedSubredditsAndUsersActivity.EXTRA_RETURN_SELECTED_SUBREDDITS));
} }
} }
} }

View File

@ -54,8 +54,11 @@ public class SearchActivity extends BaseActivity {
static final String EXTRA_SUBREDDIT_NAME = "ESN"; static final String EXTRA_SUBREDDIT_NAME = "ESN";
static final String EXTRA_SUBREDDIT_IS_USER = "ESIU"; static final String EXTRA_SUBREDDIT_IS_USER = "ESIU";
static final String EXTRA_SEARCH_ONLY_SUBREDDITS = "ESOS"; static final String EXTRA_SEARCH_ONLY_SUBREDDITS = "ESOS";
static final String EXTRA_SEARCH_ONLY_USERS = "ESOU";
static final String EXTRA_RETURN_SUBREDDIT_NAME = "ERSN"; static final String EXTRA_RETURN_SUBREDDIT_NAME = "ERSN";
static final String EXTRA_RETURN_SUBREDDIT_ICON_URL = "ERSIURL"; static final String EXTRA_RETURN_SUBREDDIT_ICON_URL = "ERSIU";
static final String EXTRA_RETURN_USER_NAME = "ERUN";
static final String EXTRA_RETURN_USER_ICON_URL = "ERUIU";
private static final String NULL_ACCOUNT_NAME_STATE = "NANS"; private static final String NULL_ACCOUNT_NAME_STATE = "NANS";
private static final String ACCOUNT_NAME_STATE = "ANS"; private static final String ACCOUNT_NAME_STATE = "ANS";
@ -64,6 +67,7 @@ public class SearchActivity extends BaseActivity {
private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 0; private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 0;
private static final int SUBREDDIT_SEARCH_REQUEST_CODE = 1; private static final int SUBREDDIT_SEARCH_REQUEST_CODE = 1;
private static final int USER_SEARCH_REQUEST_CODE = 2;
@BindView(R.id.coordinator_layout_search_activity) @BindView(R.id.coordinator_layout_search_activity)
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@ -100,6 +104,7 @@ public class SearchActivity extends BaseActivity {
private String subredditName; private String subredditName;
private boolean subredditIsUser; private boolean subredditIsUser;
private boolean searchOnlySubreddits; private boolean searchOnlySubreddits;
private boolean searchOnlyUsers;
private SearchActivityRecyclerViewAdapter adapter; private SearchActivityRecyclerViewAdapter adapter;
RecentSearchQueryViewModel mRecentSearchQueryViewModel; RecentSearchQueryViewModel mRecentSearchQueryViewModel;
@ -126,6 +131,7 @@ public class SearchActivity extends BaseActivity {
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
searchOnlySubreddits = getIntent().getBooleanExtra(EXTRA_SEARCH_ONLY_SUBREDDITS, false); searchOnlySubreddits = getIntent().getBooleanExtra(EXTRA_SEARCH_ONLY_SUBREDDITS, false);
searchOnlyUsers = getIntent().getBooleanExtra(EXTRA_SEARCH_ONLY_USERS, false);
simpleSearchView.setOnSearchViewListener(new SimpleSearchView.SearchViewListener() { simpleSearchView.setOnSearchViewListener(new SimpleSearchView.SearchViewListener() {
@Override @Override
@ -189,7 +195,7 @@ public class SearchActivity extends BaseActivity {
getCurrentAccountAndInitializeViewPager(); getCurrentAccountAndInitializeViewPager();
} }
if (searchOnlySubreddits) { if (searchOnlySubreddits || searchOnlyUsers) {
subredditNameRelativeLayout.setVisibility(View.GONE); subredditNameRelativeLayout.setVisibility(View.GONE);
} else { } else {
subredditNameRelativeLayout.setOnClickListener(view -> { subredditNameRelativeLayout.setOnClickListener(view -> {
@ -260,6 +266,10 @@ public class SearchActivity extends BaseActivity {
Intent intent = new Intent(SearchActivity.this, SearchSubredditsResultActivity.class); Intent intent = new Intent(SearchActivity.this, SearchSubredditsResultActivity.class);
intent.putExtra(SearchSubredditsResultActivity.EXTRA_QUERY, query); intent.putExtra(SearchSubredditsResultActivity.EXTRA_QUERY, query);
startActivityForResult(intent, SUBREDDIT_SEARCH_REQUEST_CODE); startActivityForResult(intent, SUBREDDIT_SEARCH_REQUEST_CODE);
} else if (searchOnlyUsers) {
Intent intent = new Intent(this, SearchUsersResultActivity.class);
intent.putExtra(SearchUsersResultActivity.EXTRA_QUERY, query);
startActivityForResult(intent, USER_SEARCH_REQUEST_CODE);
} else { } else {
Intent intent = new Intent(SearchActivity.this, SearchResultActivity.class); Intent intent = new Intent(SearchActivity.this, SearchResultActivity.class);
intent.putExtra(SearchResultActivity.EXTRA_QUERY, query); intent.putExtra(SearchResultActivity.EXTRA_QUERY, query);
@ -335,26 +345,32 @@ public class SearchActivity extends BaseActivity {
return; return;
} }
if (resultCode == RESULT_OK && data != null) {
if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) { if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) {
if (resultCode == RESULT_OK) { subredditName = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME);
subredditName = data.getExtras().getString(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME); subredditIsUser = data.getBooleanExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_IS_USER, false);
subredditIsUser = data.getExtras().getBoolean(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_IS_USER);
if (subredditName == null) { if (subredditName == null) {
subredditNameTextView.setText(R.string.all_subreddits); subredditNameTextView.setText(R.string.all_subreddits);
} else { } else {
subredditNameTextView.setText(subredditName); subredditNameTextView.setText(subredditName);
} }
}
} else if (requestCode == SUBREDDIT_SEARCH_REQUEST_CODE) { } else if (requestCode == SUBREDDIT_SEARCH_REQUEST_CODE) {
if (resultCode == RESULT_OK) { String name = data.getStringExtra(SearchSubredditsResultActivity.EXTRA_RETURN_SUBREDDIT_NAME);
String name = data.getExtras().getString(SearchSubredditsResultActivity.EXTRA_RETURN_SUBREDDIT_NAME); String iconUrl = data.getStringExtra(SearchSubredditsResultActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL);
String iconUrl = data.getExtras().getString(SearchSubredditsResultActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL);
Intent returnIntent = new Intent(); Intent returnIntent = new Intent();
returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_NAME, name); returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_NAME, name);
returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_ICON_URL, iconUrl); returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_ICON_URL, iconUrl);
setResult(Activity.RESULT_OK, returnIntent); setResult(Activity.RESULT_OK, returnIntent);
finish(); finish();
} else if (requestCode == USER_SEARCH_REQUEST_CODE) {
String username = data.getStringExtra(SearchUsersResultActivity.EXTRA_RETURN_USER_NAME);
String iconUrl = data.getStringExtra(SearchUsersResultActivity.EXTRA_RETURN_USER_ICON_URL);
Intent returnIntent = new Intent();
returnIntent.putExtra(EXTRA_RETURN_USER_NAME, username);
returnIntent.putExtra(EXTRA_RETURN_USER_ICON_URL, iconUrl);
setResult(Activity.RESULT_OK, returnIntent);
finish();
} }
} }

View File

@ -49,11 +49,11 @@ public class SearchUsersResultActivity extends BaseActivity implements ActivityT
private static final String ACCOUNT_NAME_STATE = "ANS"; private static final String ACCOUNT_NAME_STATE = "ANS";
private static final String FRAGMENT_OUT_STATE = "FOS"; private static final String FRAGMENT_OUT_STATE = "FOS";
@BindView(R.id.coordinator_layout_search_subreddits_result_activity) @BindView(R.id.coordinator_layout_search_users_result_activity)
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_search_subreddits_result_activity) @BindView(R.id.appbar_layout_search_users_result_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.toolbar_search_subreddits_result_activity) @BindView(R.id.toolbar_search_users_result_activity)
Toolbar toolbar; Toolbar toolbar;
Fragment mFragment; Fragment mFragment;
@Inject @Inject
@ -122,7 +122,7 @@ public class SearchUsersResultActivity extends BaseActivity implements ActivityT
getCurrentAccountAndInitializeFragment(query); getCurrentAccountAndInitializeFragment(query);
} else { } else {
mFragment = getSupportFragmentManager().getFragment(savedInstanceState, FRAGMENT_OUT_STATE); mFragment = getSupportFragmentManager().getFragment(savedInstanceState, FRAGMENT_OUT_STATE);
getSupportFragmentManager().beginTransaction().replace(R.id.frame_layout_search_subreddits_result_activity, mFragment).commit(); getSupportFragmentManager().beginTransaction().replace(R.id.frame_layout_search_users_result_activity, mFragment).commit();
} }
} }
} }
@ -159,7 +159,7 @@ public class SearchUsersResultActivity extends BaseActivity implements ActivityT
bundle.putString(UserListingFragment.EXTRA_ACCESS_TOKEN, mAccessToken); bundle.putString(UserListingFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
bundle.putString(UserListingFragment.EXTRA_ACCOUNT_NAME, mAccountName); bundle.putString(UserListingFragment.EXTRA_ACCOUNT_NAME, mAccountName);
mFragment.setArguments(bundle); mFragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction().replace(R.id.frame_layout_search_subreddits_result_activity, mFragment).commit(); getSupportFragmentManager().beginTransaction().replace(R.id.frame_layout_search_users_result_activity, mFragment).commit();
}); });
} }

View File

@ -27,27 +27,29 @@ import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.ActivityToolbarInterface; import ml.docilealligator.infinityforreddit.ActivityToolbarInterface;
import ml.docilealligator.infinityforreddit.adapters.SelectedSubredditsRecyclerViewAdapter; import ml.docilealligator.infinityforreddit.adapters.SelectedSubredditsRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.SelectSubredditsOrUsersOptionsBottomSheetFragment;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
public class SelectedSubredditsActivity extends BaseActivity implements ActivityToolbarInterface { public class SelectedSubredditsAndUsersActivity extends BaseActivity implements ActivityToolbarInterface {
public static final String EXTRA_SELECTED_SUBREDDITS = "ESS"; public static final String EXTRA_SELECTED_SUBREDDITS = "ESS";
public static final String EXTRA_RETURN_SELECTED_SUBREDDITS = "ERSS"; public static final String EXTRA_RETURN_SELECTED_SUBREDDITS = "ERSS";
private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 1; private static final int SUBREDDIT_SELECTION_REQUEST_CODE = 1;
private static final int USER_SELECTION_REQUEST_CODE = 2;
private static final String SELECTED_SUBREDDITS_STATE = "SSS"; private static final String SELECTED_SUBREDDITS_STATE = "SSS";
@BindView(R.id.coordinator_layout_selected_subreddits_activity) @BindView(R.id.coordinator_layout_selected_subreddits_and_users_activity)
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_selected_subreddits_activity) @BindView(R.id.appbar_layout_selected_subreddits_and_users_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.toolbar_selected_subreddits_activity) @BindView(R.id.toolbar_selected_subreddits_and_users_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.recycler_view_selected_subreddits_activity) @BindView(R.id.recycler_view_selected_subreddits_and_users_activity)
RecyclerView recyclerView; RecyclerView recyclerView;
@BindView(R.id.fab_selected_subreddits_activity) @BindView(R.id.fab_selected_subreddits_and_users_activity)
FloatingActionButton fab; FloatingActionButton fab;
@Inject @Inject
@Named("default") @Named("default")
@ -102,9 +104,20 @@ public class SelectedSubredditsActivity extends BaseActivity implements Activity
}); });
fab.setOnClickListener(view -> { fab.setOnClickListener(view -> {
SelectSubredditsOrUsersOptionsBottomSheetFragment selectSubredditsOrUsersOptionsBottomSheetFragment = new SelectSubredditsOrUsersOptionsBottomSheetFragment();
selectSubredditsOrUsersOptionsBottomSheetFragment.show(getSupportFragmentManager(), selectSubredditsOrUsersOptionsBottomSheetFragment.getTag());
});
}
public void selectSubreddits() {
Intent intent = new Intent(this, SubredditMultiselectionActivity.class); Intent intent = new Intent(this, SubredditMultiselectionActivity.class);
startActivityForResult(intent, SUBREDDIT_SELECTION_REQUEST_CODE); startActivityForResult(intent, SUBREDDIT_SELECTION_REQUEST_CODE);
}); }
public void selectUsers() {
Intent intent = new Intent(this, SearchActivity.class);
intent.putExtra(SearchActivity.EXTRA_SEARCH_ONLY_USERS, true);
startActivityForResult(intent, USER_SELECTION_REQUEST_CODE);
} }
@Override @Override
@ -133,7 +146,8 @@ public class SelectedSubredditsActivity extends BaseActivity implements Activity
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE && resultCode == RESULT_OK) { if (resultCode == RESULT_OK) {
if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) {
if (data != null) { if (data != null) {
if (subreddits == null) { if (subreddits == null) {
subreddits = new ArrayList<>(); subreddits = new ArrayList<>();
@ -141,6 +155,14 @@ public class SelectedSubredditsActivity extends BaseActivity implements Activity
subreddits = data.getStringArrayListExtra(SubredditMultiselectionActivity.EXTRA_RETURN_SELECTED_SUBREDDITS); subreddits = data.getStringArrayListExtra(SubredditMultiselectionActivity.EXTRA_RETURN_SELECTED_SUBREDDITS);
adapter.addSubreddits(subreddits); adapter.addSubreddits(subreddits);
} }
} else if (requestCode == USER_SELECTION_REQUEST_CODE) {
if (data != null) {
if (subreddits == null) {
subreddits = new ArrayList<>();
}
adapter.addUserInSubredditType("u_" + data.getStringExtra(SearchActivity.EXTRA_RETURN_USER_NAME));
}
}
} }
} }

View File

@ -234,11 +234,11 @@ public class SubredditSelectionActivity extends BaseActivity implements Activity
@Override @Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) { public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) { int itemId = item.getItemId();
case android.R.id.home: if (itemId == android.R.id.home) {
finish(); finish();
return true; return true;
case R.id.action_search_subreddit_selection_activity: } else if (itemId == R.id.action_search_subreddit_selection_activity) {
Intent intent = new Intent(this, SearchActivity.class); Intent intent = new Intent(this, SearchActivity.class);
intent.putExtra(SearchActivity.EXTRA_SEARCH_ONLY_SUBREDDITS, true); intent.putExtra(SearchActivity.EXTRA_SEARCH_ONLY_SUBREDDITS, true);
startActivityForResult(intent, SUBREDDIT_SEARCH_REQUEST_CODE); startActivityForResult(intent, SUBREDDIT_SEARCH_REQUEST_CODE);

View File

@ -58,6 +58,11 @@ public class SelectedSubredditsRecyclerViewAdapter extends RecyclerView.Adapter<
notifyItemRangeInserted(oldSize, newSubreddits.size()); notifyItemRangeInserted(oldSize, newSubreddits.size());
} }
public void addUserInSubredditType(String username) {
subreddits.add(username);
notifyItemInserted(subreddits.size());
}
public ArrayList<String> getSubreddits() { public ArrayList<String> getSubreddits() {
return subreddits; return subreddits;
} }

View File

@ -0,0 +1,57 @@
package ml.docilealligator.infinityforreddit.bottomsheetfragments;
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;
import ml.docilealligator.infinityforreddit.activities.SelectedSubredditsAndUsersActivity;
public class SelectSubredditsOrUsersOptionsBottomSheetFragment extends RoundedBottomSheetDialogFragment {
@BindView(R.id.select_subreddits_text_view_search_user_and_subreddit_sort_type_bottom_sheet_fragment)
TextView selectSubredditsTextView;
@BindView(R.id.select_users_text_view_search_user_and_subreddit_sort_type_bottom_sheet_fragment)
TextView selectUsersTextView;
private SelectedSubredditsAndUsersActivity activity;
public SelectSubredditsOrUsersOptionsBottomSheetFragment() {
// 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_select_subreddits_or_users_options_bottom_sheet, container, false);
ButterKnife.bind(this, rootView);
selectSubredditsTextView.setOnClickListener(view -> {
activity.selectSubreddits();
dismiss();
});
selectUsersTextView.setOnClickListener(view -> {
activity.selectUsers();
dismiss();
});
return rootView;
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
activity = (SelectedSubredditsAndUsersActivity) context;
}
}

View File

@ -109,7 +109,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="16dp" android:padding="16dp"
android:text="@string/select_subreddits" android:text="@string/select_subreddits_and_users"
android:textSize="?attr/font_default" android:textSize="?attr/font_default"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:fontFamily="?attr/font_family" android:fontFamily="?attr/font_family"

View File

@ -115,7 +115,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="16dp" android:padding="16dp"
android:text="@string/select_subreddits" android:text="@string/select_subreddits_and_users"
android:textSize="?attr/font_default" android:textSize="?attr/font_default"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:clickable="true" android:clickable="true"

View File

@ -4,11 +4,11 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/coordinator_layout_selected_subreddits_activity" android:id="@+id/coordinator_layout_selected_subreddits_and_users_activity"
tools:context=".activities.AccountPostsActivity"> tools:context=".activities.AccountPostsActivity">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_layout_selected_subreddits_activity" android:id="@+id/appbar_layout_selected_subreddits_and_users_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
@ -18,10 +18,10 @@
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false" app:titleEnabled="false"
app:toolbarId="@+id/toolbar_selected_subreddits_activity"> app:toolbarId="@+id/toolbar_selected_subreddits_and_users_activity">
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_selected_subreddits_activity" android:id="@+id/toolbar_selected_subreddits_and_users_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
@ -33,13 +33,13 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_selected_subreddits_activity" android:id="@+id/recycler_view_selected_subreddits_and_users_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_selected_subreddits_activity" android:id="@+id/fab_selected_subreddits_and_users_activity"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/select_subreddits_text_view_search_user_and_subreddit_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/subreddit"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/select_users_text_view_search_user_and_subreddit_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/user"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -491,7 +491,7 @@ Funktioniert vielleicht nicht auf Android 11"</string>
<string name="multi_reddit_name_hint">"Name (Max. 50 Zeichen)"</string> <string name="multi_reddit_name_hint">"Name (Max. 50 Zeichen)"</string>
<string name="multi_reddit_description_hint">"Beschreibung"</string> <string name="multi_reddit_description_hint">"Beschreibung"</string>
<string name="private_multi_reddit">"Privat"</string> <string name="private_multi_reddit">"Privat"</string>
<string name="select_subreddits">"Subreddits auswählen"</string> <string name="select_subreddits_and_users">"Subreddits auswählen"</string>
<string name="no_multi_reddit_name">"Wo ist der Name?"</string> <string name="no_multi_reddit_name">"Wo ist der Name?"</string>
<string name="create_multi_reddit_failed">"Kann dieses Multireddit nicht erstellen"</string> <string name="create_multi_reddit_failed">"Kann dieses Multireddit nicht erstellen"</string>
<string name="duplicate_multi_reddit">"Dieses Multireddit existiert bereits"</string> <string name="duplicate_multi_reddit">"Dieses Multireddit existiert bereits"</string>

View File

@ -502,7 +502,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"Nombre (Max. 50 Caracteres)"</string> <string name="multi_reddit_name_hint">"Nombre (Max. 50 Caracteres)"</string>
<string name="multi_reddit_description_hint">"Descripción"</string> <string name="multi_reddit_description_hint">"Descripción"</string>
<string name="private_multi_reddit">"Privado"</string> <string name="private_multi_reddit">"Privado"</string>
<string name="select_subreddits">"Selecciona Subreddits"</string> <string name="select_subreddits_and_users">"Selecciona Subreddits"</string>
<string name="no_multi_reddit_name">"Introduce un nombre"</string> <string name="no_multi_reddit_name">"Introduce un nombre"</string>
<string name="create_multi_reddit_failed">"Ocurrió un error creando este multireddit"</string> <string name="create_multi_reddit_failed">"Ocurrió un error creando este multireddit"</string>
<string name="duplicate_multi_reddit">"Este multireddit ya existe"</string> <string name="duplicate_multi_reddit">"Este multireddit ya existe"</string>

View File

@ -531,7 +531,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"Nom ( Max. 50 caractères )"</string> <string name="multi_reddit_name_hint">"Nom ( Max. 50 caractères )"</string>
<string name="multi_reddit_description_hint">"Description"</string> <string name="multi_reddit_description_hint">"Description"</string>
<string name="private_multi_reddit">"Privé"</string> <string name="private_multi_reddit">"Privé"</string>
<string name="select_subreddits">"Sélectionnez des Subreddits"</string> <string name="select_subreddits_and_users">"Sélectionnez des Subreddits"</string>
<string name="no_multi_reddit_name">"Où est le nom ?"</string> <string name="no_multi_reddit_name">"Où est le nom ?"</string>
<string name="create_multi_reddit_failed">"Impossible de créer ce multireddit"</string> <string name="create_multi_reddit_failed">"Impossible de créer ce multireddit"</string>
<string name="duplicate_multi_reddit">"Ce multireddit existe déjà"</string> <string name="duplicate_multi_reddit">"Ce multireddit existe déjà"</string>

View File

@ -522,7 +522,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"नाम (अधिकतम 50 वर्ण)"</string> <string name="multi_reddit_name_hint">"नाम (अधिकतम 50 वर्ण)"</string>
<string name="multi_reddit_description_hint">"विवरण "</string> <string name="multi_reddit_description_hint">"विवरण "</string>
<string name="private_multi_reddit">"गुप्त "</string> <string name="private_multi_reddit">"गुप्त "</string>
<string name="select_subreddits">"सबरैडिट चुनें "</string> <string name="select_subreddits_and_users">"सबरैडिट चुनें "</string>
<string name="no_multi_reddit_name">"नाम कहाँ है? "</string> <string name="no_multi_reddit_name">"नाम कहाँ है? "</string>
<string name="create_multi_reddit_failed">"इस मल्टीरैडिट का निर्माण असफल "</string> <string name="create_multi_reddit_failed">"इस मल्टीरैडिट का निर्माण असफल "</string>
<string name="duplicate_multi_reddit">"यह मल्टीरैडिट पहले से उपलब्ध है "</string> <string name="duplicate_multi_reddit">"यह मल्टीरैडिट पहले से उपलब्ध है "</string>

View File

@ -489,7 +489,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"Ime (max. 50 znakova)"</string> <string name="multi_reddit_name_hint">"Ime (max. 50 znakova)"</string>
<string name="multi_reddit_description_hint">"Opis"</string> <string name="multi_reddit_description_hint">"Opis"</string>
<string name="private_multi_reddit">"Privatno"</string> <string name="private_multi_reddit">"Privatno"</string>
<string name="select_subreddits">"Odaberi podreddite"</string> <string name="select_subreddits_and_users">"Odaberi podreddite"</string>
<string name="no_multi_reddit_name">"Gdje je ime?"</string> <string name="no_multi_reddit_name">"Gdje je ime?"</string>
<string name="create_multi_reddit_failed">"Nije moguće stvoriti ovaj multireddit"</string> <string name="create_multi_reddit_failed">"Nije moguće stvoriti ovaj multireddit"</string>
<string name="duplicate_multi_reddit">"Ovaj multireddit već postoji"</string> <string name="duplicate_multi_reddit">"Ovaj multireddit već postoji"</string>

View File

@ -500,7 +500,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"Nome (massimo 50 caratteri)"</string> <string name="multi_reddit_name_hint">"Nome (massimo 50 caratteri)"</string>
<string name="multi_reddit_description_hint">"Descrizione"</string> <string name="multi_reddit_description_hint">"Descrizione"</string>
<string name="private_multi_reddit">"Privato"</string> <string name="private_multi_reddit">"Privato"</string>
<string name="select_subreddits">"Seleziona Subreddit"</string> <string name="select_subreddits_and_users">"Seleziona Subreddit"</string>
<string name="no_multi_reddit_name">"Dov'è il nome?"</string> <string name="no_multi_reddit_name">"Dov'è il nome?"</string>
<string name="create_multi_reddit_failed">"Impossibile creare questo multireddit"</string> <string name="create_multi_reddit_failed">"Impossibile creare questo multireddit"</string>
<string name="duplicate_multi_reddit">"Il multireddit esiste già"</string> <string name="duplicate_multi_reddit">"Il multireddit esiste già"</string>

View File

@ -523,7 +523,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"名前 (最大50文字)"</string> <string name="multi_reddit_name_hint">"名前 (最大50文字)"</string>
<string name="multi_reddit_description_hint">"詳細"</string> <string name="multi_reddit_description_hint">"詳細"</string>
<string name="private_multi_reddit">"プライベート"</string> <string name="private_multi_reddit">"プライベート"</string>
<string name="select_subreddits">"Subredditを選択"</string> <string name="select_subreddits_and_users">"Subredditを選択"</string>
<string name="no_multi_reddit_name">"名前が必要です。"</string> <string name="no_multi_reddit_name">"名前が必要です。"</string>
<string name="create_multi_reddit_failed">"このカスタムフィードを作成できませんでした"</string> <string name="create_multi_reddit_failed">"このカスタムフィードを作成できませんでした"</string>
<string name="duplicate_multi_reddit">"このカスタムフィードは既に存在しています"</string> <string name="duplicate_multi_reddit">"このカスタムフィードは既に存在しています"</string>

View File

@ -476,7 +476,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"Nome (Limite de 50 caracteres)"</string> <string name="multi_reddit_name_hint">"Nome (Limite de 50 caracteres)"</string>
<string name="multi_reddit_description_hint">"Descrição"</string> <string name="multi_reddit_description_hint">"Descrição"</string>
<string name="private_multi_reddit">"Privado"</string> <string name="private_multi_reddit">"Privado"</string>
<string name="select_subreddits">"Selecionar Subreddits"</string> <string name="select_subreddits_and_users">"Selecionar Subreddits"</string>
<string name="no_multi_reddit_name">"Onde está o nome?"</string> <string name="no_multi_reddit_name">"Onde está o nome?"</string>
<string name="create_multi_reddit_failed">"Não foi possível criar este multiReddit"</string> <string name="create_multi_reddit_failed">"Não foi possível criar este multiReddit"</string>
<string name="duplicate_multi_reddit">"Este multiReddit já existe"</string> <string name="duplicate_multi_reddit">"Este multiReddit já existe"</string>

View File

@ -485,7 +485,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"Ad (Maks 50 Karakter)"</string> <string name="multi_reddit_name_hint">"Ad (Maks 50 Karakter)"</string>
<string name="multi_reddit_description_hint">"Açıklama"</string> <string name="multi_reddit_description_hint">"Açıklama"</string>
<string name="private_multi_reddit">"Özel"</string> <string name="private_multi_reddit">"Özel"</string>
<string name="select_subreddits">"Subredditleri Seç"</string> <string name="select_subreddits_and_users">"Subredditleri Seç"</string>
<string name="no_multi_reddit_name">"Ad nerede?"</string> <string name="no_multi_reddit_name">"Ad nerede?"</string>
<string name="create_multi_reddit_failed">"Bu multireddit oluşturulamıyor"</string> <string name="create_multi_reddit_failed">"Bu multireddit oluşturulamıyor"</string>
<string name="duplicate_multi_reddit">"Bu multireddit zaten var"</string> <string name="duplicate_multi_reddit">"Bu multireddit zaten var"</string>

View File

@ -491,7 +491,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="multi_reddit_name_hint">"名称最多50个字符"</string> <string name="multi_reddit_name_hint">"名称最多50个字符"</string>
<string name="multi_reddit_description_hint">"描述"</string> <string name="multi_reddit_description_hint">"描述"</string>
<string name="private_multi_reddit">"私人的"</string> <string name="private_multi_reddit">"私人的"</string>
<string name="select_subreddits">"选择板块"</string> <string name="select_subreddits_and_users">"选择板块"</string>
<string name="no_multi_reddit_name">"名字在哪里?"</string> <string name="no_multi_reddit_name">"名字在哪里?"</string>
<string name="create_multi_reddit_failed">"不能创建这个复合reddit"</string> <string name="create_multi_reddit_failed">"不能创建这个复合reddit"</string>
<string name="duplicate_multi_reddit">"这个复合reddit已经存在"</string> <string name="duplicate_multi_reddit">"这个复合reddit已经存在"</string>

View File

@ -608,7 +608,7 @@
<string name="multi_reddit_name_hint">Name (Max 50 Characters)</string> <string name="multi_reddit_name_hint">Name (Max 50 Characters)</string>
<string name="multi_reddit_description_hint">Description</string> <string name="multi_reddit_description_hint">Description</string>
<string name="private_multi_reddit">Private</string> <string name="private_multi_reddit">Private</string>
<string name="select_subreddits">Select Subreddits</string> <string name="select_subreddits_and_users">Select Subreddits and Users</string>
<string name="no_multi_reddit_name">Where is the name?</string> <string name="no_multi_reddit_name">Where is the name?</string>
<string name="create_multi_reddit_failed">Cannot create this multireddit</string> <string name="create_multi_reddit_failed">Cannot create this multireddit</string>
<string name="duplicate_multi_reddit">This multireddit already exists</string> <string name="duplicate_multi_reddit">This multireddit already exists</string>