mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
Add an activity for theme preview.
This commit is contained in:
parent
5f7ac4349f
commit
9690c5eeac
@ -21,7 +21,12 @@
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:label">
|
||||
<activity android:name=".Activity.CustomThemeListingActivity"
|
||||
<activity android:name=".Activity.ThemePreviewActivity"
|
||||
android:label="@string/theme_preview_activity_label"
|
||||
android:parentActivityName=".Activity.MainActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".Activity.CustomThemeListingActivity"
|
||||
android:label="@string/custom_theme_listing_activity_label"
|
||||
android:parentActivityName=".Activity.MainActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@ -266,9 +271,9 @@
|
||||
android:theme="@style/AppTheme.ActionBar.Transparent" />
|
||||
<activity
|
||||
android:name=".Activity.ViewVideoActivity"
|
||||
android:configChanges="orientation|screenSize|layoutDirection"
|
||||
android:parentActivityName=".Activity.MainActivity"
|
||||
android:theme="@style/AppTheme.ActionBar.Transparent"
|
||||
android:configChanges="orientation|screenSize|layoutDirection" />
|
||||
android:theme="@style/AppTheme.ActionBar.Transparent" />
|
||||
<activity
|
||||
android:name=".Activity.ViewPostDetailActivity"
|
||||
android:parentActivityName=".Activity.MainActivity"
|
||||
|
@ -1,5 +1,6 @@
|
||||
package ml.docilealligator.infinityforreddit.Activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -188,6 +189,12 @@ public class CustomizeThemeActivity extends BaseActivity {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_preview_customize_theme_activity:
|
||||
Intent intent = new Intent(this, ThemePreviewActivity.class);
|
||||
intent.putParcelableArrayListExtra(ThemePreviewActivity.EXTRA_CUSTOM_THEME_SETTINGS_ITEMS, customThemeSettingsItems);
|
||||
startActivity(intent);
|
||||
|
||||
return true;
|
||||
case R.id.action_save_customize_theme_activity:
|
||||
if (adapter != null) {
|
||||
|
@ -0,0 +1,448 @@
|
||||
package ml.docilealligator.infinityforreddit.Activity;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.TypedValue;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.appbar.CollapsingToolbarLayout;
|
||||
import com.google.android.material.bottomappbar.BottomAppBar;
|
||||
import com.google.android.material.chip.Chip;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
|
||||
import ml.docilealligator.infinityforreddit.ContentFontStyle;
|
||||
import ml.docilealligator.infinityforreddit.CustomTheme.CustomTheme;
|
||||
import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeSettingsItem;
|
||||
import ml.docilealligator.infinityforreddit.FontStyle;
|
||||
import ml.docilealligator.infinityforreddit.Fragment.ThemePreviewCommentsFragment;
|
||||
import ml.docilealligator.infinityforreddit.Fragment.ThemePreviewPostsFragment;
|
||||
import ml.docilealligator.infinityforreddit.Infinity;
|
||||
import ml.docilealligator.infinityforreddit.R;
|
||||
import ml.docilealligator.infinityforreddit.TitleFontStyle;
|
||||
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
|
||||
|
||||
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
|
||||
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
|
||||
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO;
|
||||
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
|
||||
|
||||
public class ThemePreviewActivity extends AppCompatActivity {
|
||||
|
||||
public static final String EXTRA_CUSTOM_THEME_SETTINGS_ITEMS = "ECTSI";
|
||||
|
||||
@BindView(R.id.coordinator_layout_theme_preview_activity)
|
||||
CoordinatorLayout coordinatorLayout;
|
||||
@BindView(R.id.view_pager_theme_preview_activity)
|
||||
ViewPager viewPager;
|
||||
@BindView(R.id.appbar_layout_theme_preview_activity)
|
||||
AppBarLayout appBarLayout;
|
||||
@BindView(R.id.collapsing_toolbar_layout_theme_preview_activity)
|
||||
CollapsingToolbarLayout collapsingToolbarLayout;
|
||||
@BindView(R.id.toolbar_linear_layout_theme_preview_activity)
|
||||
LinearLayout linearLayout;
|
||||
@BindView(R.id.subreddit_name_text_view_theme_preview_activity)
|
||||
TextView subredditNameTextView;
|
||||
@BindView(R.id.user_name_text_view_theme_preview_activity)
|
||||
TextView usernameTextView;
|
||||
@BindView(R.id.subscribe_subreddit_chip_theme_preview_activity)
|
||||
Chip subscribeSubredditChip;
|
||||
@BindView(R.id.primary_text_text_view_theme_preview_activity)
|
||||
TextView primaryTextView;
|
||||
@BindView(R.id.secondary_text_text_view_theme_preview_activity)
|
||||
TextView secondaryTextView;
|
||||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
@BindView(R.id.tab_layout_theme_preview_activity)
|
||||
TabLayout tabLayout;
|
||||
@BindView(R.id.bottom_navigation_theme_preview_activity)
|
||||
BottomAppBar bottomNavigationView;
|
||||
@BindView(R.id.linear_layout_bottom_app_bar_theme_preview_activity)
|
||||
LinearLayout linearLayoutBottomAppBar;
|
||||
@BindView(R.id.subscriptions_bottom_app_bar_theme_preview_activity)
|
||||
ImageView subscriptionsBottomAppBar;
|
||||
@BindView(R.id.multi_reddit_bottom_app_bar_theme_preview_activity)
|
||||
ImageView multiRedditBottomAppBar;
|
||||
@BindView(R.id.message_bottom_app_bar_theme_preview_activity)
|
||||
ImageView messageBottomAppBar;
|
||||
@BindView(R.id.profile_bottom_app_bar_theme_preview_activity)
|
||||
ImageView profileBottomAppBar;
|
||||
@BindView(R.id.fab_theme_preview_activity)
|
||||
FloatingActionButton fab;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private ArrayList<CustomThemeSettingsItem> customThemeSettingsItems;
|
||||
private CustomTheme customTheme;
|
||||
private int expandedTabTextColor;
|
||||
private int expandedTabBackgroundColor;
|
||||
private int expandedTabIndicatorColor;
|
||||
private int collapsedTabTextColor;
|
||||
private int collapsedTabBackgroundColor;
|
||||
private int collapsedTabIndicatorColor;
|
||||
private int unsubscribedColor;
|
||||
private int subscribedColor;
|
||||
private int systemVisibilityToolbarExpanded = 0;
|
||||
private int systemVisibilityToolbarCollapsed = 0;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
((Infinity) getApplication()).getAppComponent().inject(this);
|
||||
|
||||
customThemeSettingsItems = getIntent().getParcelableArrayListExtra(EXTRA_CUSTOM_THEME_SETTINGS_ITEMS);
|
||||
customTheme = CustomTheme.convertSettingsItemsToCustomTheme(customThemeSettingsItems, "ThemePreview");
|
||||
|
||||
boolean systemDefault = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q;
|
||||
int systemThemeType = Integer.parseInt(mSharedPreferences.getString(SharedPreferencesUtils.THEME_KEY, "2"));
|
||||
switch (systemThemeType) {
|
||||
case 0:
|
||||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO);
|
||||
getTheme().applyStyle(R.style.Theme_Normal, true);
|
||||
break;
|
||||
case 1:
|
||||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_YES);
|
||||
if(mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
|
||||
getTheme().applyStyle(R.style.Theme_Normal_AmoledDark, true);
|
||||
} else {
|
||||
getTheme().applyStyle(R.style.Theme_Normal_NormalDark, true);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (systemDefault) {
|
||||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_FOLLOW_SYSTEM);
|
||||
} else {
|
||||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_AUTO_BATTERY);
|
||||
}
|
||||
if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_NO) {
|
||||
getTheme().applyStyle(R.style.Theme_Normal, true);
|
||||
} else {
|
||||
if(mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
|
||||
getTheme().applyStyle(R.style.Theme_Normal_AmoledDark, true);
|
||||
} else {
|
||||
getTheme().applyStyle(R.style.Theme_Normal_NormalDark, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean immersiveInterface = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
||||
mSharedPreferences.getBoolean(SharedPreferencesUtils.IMMERSIVE_INTERFACE_KEY, true);
|
||||
boolean changeStatusBarIconColor = false;
|
||||
if (immersiveInterface) {
|
||||
changeStatusBarIconColor = customTheme.isChangeStatusBarIconColorAfterToolbarCollapsedInImmersiveInterface;
|
||||
}
|
||||
boolean isLightStatusbar = customTheme.isLightStatusBar;
|
||||
Window window = getWindow();
|
||||
View decorView = window.getDecorView();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
boolean isLightNavBar = customTheme.isLightNavBar;
|
||||
if (isLightStatusbar) {
|
||||
if (isLightNavBar) {
|
||||
systemVisibilityToolbarExpanded = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
|
||||
if (changeStatusBarIconColor) {
|
||||
systemVisibilityToolbarCollapsed = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
|
||||
} else {
|
||||
systemVisibilityToolbarCollapsed = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
|
||||
}
|
||||
} else {
|
||||
systemVisibilityToolbarExpanded = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||
if (!changeStatusBarIconColor) {
|
||||
systemVisibilityToolbarCollapsed = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isLightNavBar) {
|
||||
systemVisibilityToolbarExpanded = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
|
||||
if (changeStatusBarIconColor) {
|
||||
systemVisibilityToolbarCollapsed = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
|
||||
}
|
||||
} else {
|
||||
if (changeStatusBarIconColor) {
|
||||
systemVisibilityToolbarCollapsed = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||
}
|
||||
}
|
||||
}
|
||||
decorView.setSystemUiVisibility(systemVisibilityToolbarExpanded);
|
||||
window.setNavigationBarColor(customTheme.navBarColor);
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (isLightStatusbar) {
|
||||
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||
systemVisibilityToolbarExpanded = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||
systemVisibilityToolbarCollapsed = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||
}
|
||||
}
|
||||
|
||||
getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences
|
||||
.getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true);
|
||||
|
||||
getTheme().applyStyle(TitleFontStyle.valueOf(mSharedPreferences
|
||||
.getString(SharedPreferencesUtils.TITLE_FONT_SIZE_KEY, TitleFontStyle.Normal.name())).getResId(), true);
|
||||
|
||||
getTheme().applyStyle(ContentFontStyle.valueOf(mSharedPreferences
|
||||
.getString(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY, ContentFontStyle.Normal.name())).getResId(), true);
|
||||
|
||||
setContentView(R.layout.activity_theme_preview);
|
||||
|
||||
ButterKnife.bind(this);
|
||||
applyCustomTheme();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (immersiveInterface) {
|
||||
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
||||
|
||||
Resources resources = getResources();
|
||||
int navBarResourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (navBarResourceId > 0) {
|
||||
int navBarHeight = resources.getDimensionPixelSize(navBarResourceId);
|
||||
if (navBarHeight > 0) {
|
||||
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
|
||||
params.bottomMargin = navBarHeight;
|
||||
fab.setLayoutParams(params);
|
||||
linearLayoutBottomAppBar.setPadding(0,
|
||||
(int) (6 * getResources().getDisplayMetrics().density), 0, navBarHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changeStatusBarIconColor) {
|
||||
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||
@Override
|
||||
public void onStateChanged(AppBarLayout appBarLayout, AppBarStateChangeListener.State state) {
|
||||
if (state == State.COLLAPSED) {
|
||||
decorView.setSystemUiVisibility(systemVisibilityToolbarCollapsed);
|
||||
tabLayout.setTabTextColors(collapsedTabTextColor, collapsedTabTextColor);
|
||||
tabLayout.setSelectedTabIndicatorColor(collapsedTabIndicatorColor);
|
||||
tabLayout.setBackgroundColor(collapsedTabBackgroundColor);
|
||||
} else if (state == State.EXPANDED) {
|
||||
decorView.setSystemUiVisibility(systemVisibilityToolbarExpanded);
|
||||
tabLayout.setTabTextColors(expandedTabTextColor, expandedTabTextColor);
|
||||
tabLayout.setSelectedTabIndicatorColor(expandedTabIndicatorColor);
|
||||
tabLayout.setBackgroundColor(expandedTabBackgroundColor);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||
@Override
|
||||
public void onStateChanged(AppBarLayout appBarLayout, AppBarStateChangeListener.State state) {
|
||||
if (state == State.COLLAPSED) {
|
||||
tabLayout.setTabTextColors(collapsedTabTextColor, collapsedTabTextColor);
|
||||
tabLayout.setSelectedTabIndicatorColor(collapsedTabIndicatorColor);
|
||||
tabLayout.setBackgroundColor(collapsedTabBackgroundColor);
|
||||
} else if (state == State.EXPANDED) {
|
||||
tabLayout.setTabTextColors(expandedTabTextColor, expandedTabTextColor);
|
||||
tabLayout.setSelectedTabIndicatorColor(expandedTabIndicatorColor);
|
||||
tabLayout.setBackgroundColor(expandedTabBackgroundColor);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||
@Override
|
||||
public void onStateChanged(AppBarLayout appBarLayout, State state) {
|
||||
if (state == State.EXPANDED) {
|
||||
tabLayout.setTabTextColors(expandedTabTextColor, expandedTabTextColor);
|
||||
tabLayout.setSelectedTabIndicatorColor(expandedTabIndicatorColor);
|
||||
tabLayout.setBackgroundColor(expandedTabBackgroundColor);
|
||||
} else if (state == State.COLLAPSED) {
|
||||
tabLayout.setTabTextColors(collapsedTabTextColor, collapsedTabTextColor);
|
||||
tabLayout.setSelectedTabIndicatorColor(collapsedTabIndicatorColor);
|
||||
tabLayout.setBackgroundColor(collapsedTabBackgroundColor);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
adjustToolbar(toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
subscribeSubredditChip.setOnClickListener(view -> {
|
||||
if (subscribeSubredditChip.getText().equals(getResources().getString(R.string.subscribe))) {
|
||||
subscribeSubredditChip.setText(R.string.unsubscribe);
|
||||
subscribeSubredditChip.setChipBackgroundColor(ColorStateList.valueOf(subscribedColor));
|
||||
} else {
|
||||
subscribeSubredditChip.setText(R.string.subscribe);
|
||||
subscribeSubredditChip.setChipBackgroundColor(ColorStateList.valueOf(unsubscribedColor));
|
||||
}
|
||||
});
|
||||
|
||||
SectionsPagerAdapter sectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
||||
viewPager.setAdapter(sectionsPagerAdapter);
|
||||
viewPager.setOffscreenPageLimit(2);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
}
|
||||
|
||||
private void applyCustomTheme() {
|
||||
coordinatorLayout.setBackgroundColor(customTheme.backgroundColor);
|
||||
collapsingToolbarLayout.setContentScrimColor(customTheme.colorPrimary);
|
||||
subscribeSubredditChip.setTextColor(customTheme.chipTextColor);
|
||||
subscribeSubredditChip.setChipBackgroundColor(ColorStateList.valueOf(customTheme.unsubscribed));
|
||||
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar);
|
||||
expandedTabTextColor = customTheme.tabLayoutWithExpandedCollapsingToolbarTextColor;
|
||||
expandedTabIndicatorColor = customTheme.tabLayoutWithExpandedCollapsingToolbarTabIndicator;
|
||||
expandedTabBackgroundColor = customTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground;
|
||||
collapsedTabTextColor = customTheme.tabLayoutWithCollapsedCollapsingToolbarTextColor;
|
||||
collapsedTabIndicatorColor = customTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator;
|
||||
collapsedTabBackgroundColor = customTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground;
|
||||
linearLayout.setBackgroundColor(customTheme.backgroundColor);
|
||||
subredditNameTextView.setTextColor(customTheme.subreddit);
|
||||
usernameTextView.setTextColor(customTheme.username);
|
||||
subscribeSubredditChip.setTextColor(customTheme.chipTextColor);
|
||||
primaryTextView.setTextColor(customTheme.primaryTextColor);
|
||||
secondaryTextView.setTextColor(customTheme.secondaryTextColor);
|
||||
bottomNavigationView.setBackgroundTint(ColorStateList.valueOf(customTheme.backgroundColor));
|
||||
int primaryIconColor = customTheme.primaryIconColor;
|
||||
subscriptionsBottomAppBar.setColorFilter(primaryIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
multiRedditBottomAppBar.setColorFilter(primaryIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
messageBottomAppBar.setColorFilter(primaryIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
profileBottomAppBar.setColorFilter(primaryIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
applyTabLayoutTheme(tabLayout);
|
||||
applyFABTheme(fab);
|
||||
unsubscribedColor = customTheme.unsubscribed;
|
||||
subscribedColor = customTheme.subscribed;
|
||||
}
|
||||
|
||||
protected void applyAppBarLayoutAndToolbarTheme(AppBarLayout appBarLayout, Toolbar toolbar) {
|
||||
appBarLayout.setBackgroundColor(customTheme.colorPrimary);
|
||||
toolbar.setTitleTextColor(customTheme.toolbarPrimaryTextAndIconColor);
|
||||
if (toolbar.getNavigationIcon() != null) {
|
||||
toolbar.getNavigationIcon().setColorFilter(customTheme.toolbarPrimaryTextAndIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
if (toolbar.getOverflowIcon() != null) {
|
||||
toolbar.getOverflowIcon().setColorFilter(customTheme.toolbarPrimaryTextAndIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
}
|
||||
|
||||
private void adjustToolbar(Toolbar toolbar) {
|
||||
int statusBarResourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||
if (statusBarResourceId > 0) {
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
|
||||
int statusBarHeight = getResources().getDimensionPixelSize(statusBarResourceId);
|
||||
params.topMargin = statusBarHeight;
|
||||
toolbar.setLayoutParams(params);
|
||||
TypedValue tv = new TypedValue();
|
||||
if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
|
||||
{
|
||||
int dp16 = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics());
|
||||
linearLayout.setPadding(dp16,
|
||||
TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics()) + statusBarHeight,
|
||||
dp16, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void applyTabLayoutTheme(TabLayout tabLayout) {
|
||||
int toolbarAndTabBackgroundColor = customTheme.colorPrimary;
|
||||
tabLayout.setBackgroundColor(toolbarAndTabBackgroundColor);
|
||||
tabLayout.setSelectedTabIndicatorColor(customTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator);
|
||||
tabLayout.setTabTextColors(customTheme.tabLayoutWithCollapsedCollapsingToolbarTextColor,
|
||||
customTheme.tabLayoutWithCollapsedCollapsingToolbarTextColor);
|
||||
}
|
||||
|
||||
protected void applyFABTheme(FloatingActionButton fab) {
|
||||
fab.setBackgroundTintList(ColorStateList.valueOf(customTheme.colorPrimaryLightTheme));
|
||||
fab.setImageTintList(ColorStateList.valueOf(customTheme.fabIconColor));
|
||||
Drawable myFabSrc = getResources().getDrawable(R.drawable.ic_add_day_night_24dp);
|
||||
if (myFabSrc.getConstantState() != null) {
|
||||
Drawable willBeWhite = myFabSrc.getConstantState().newDrawable();
|
||||
willBeWhite.mutate().setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_IN);
|
||||
fab.setImageDrawable(willBeWhite);
|
||||
}
|
||||
}
|
||||
|
||||
public CustomTheme getCustomTheme() {
|
||||
return customTheme;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private class SectionsPagerAdapter extends FragmentPagerAdapter {
|
||||
private ThemePreviewPostsFragment themePreviewPostsFragment;
|
||||
private ThemePreviewCommentsFragment themePreviewCommentsFragment;
|
||||
|
||||
SectionsPagerAdapter(FragmentManager fm) {
|
||||
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
if (position == 0) {
|
||||
return new ThemePreviewPostsFragment();
|
||||
}
|
||||
return new ThemePreviewCommentsFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
return "Posts";
|
||||
case 1:
|
||||
return "Comments";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
||||
Fragment fragment = (Fragment) super.instantiateItem(container, position);
|
||||
switch (position) {
|
||||
case 0:
|
||||
themePreviewPostsFragment = (ThemePreviewPostsFragment) fragment;
|
||||
break;
|
||||
case 1:
|
||||
themePreviewCommentsFragment = (ThemePreviewCommentsFragment) fragment;
|
||||
}
|
||||
return fragment;
|
||||
}
|
||||
}
|
||||
}
|
@ -97,7 +97,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
||||
CoordinatorLayout coordinatorLayout;
|
||||
@BindView(R.id.view_pager_view_subreddit_detail_activity)
|
||||
ViewPager viewPager;
|
||||
@BindView(R.id.appbar_layout_view_subreddit_detail)
|
||||
@BindView(R.id.appbar_layout_view_subreddit_detail_activity)
|
||||
AppBarLayout appBarLayout;
|
||||
@BindView(R.id.collapsing_toolbar_layout_view_subreddit_detail_activity)
|
||||
CollapsingToolbarLayout collapsingToolbarLayout;
|
||||
|
@ -28,6 +28,7 @@ import ml.docilealligator.infinityforreddit.Activity.SettingsActivity;
|
||||
import ml.docilealligator.infinityforreddit.Activity.SubredditMultiselectionActivity;
|
||||
import ml.docilealligator.infinityforreddit.Activity.SubredditSelectionActivity;
|
||||
import ml.docilealligator.infinityforreddit.Activity.SubscribedThingListingActivity;
|
||||
import ml.docilealligator.infinityforreddit.Activity.ThemePreviewActivity;
|
||||
import ml.docilealligator.infinityforreddit.Activity.ViewGIFActivity;
|
||||
import ml.docilealligator.infinityforreddit.Activity.ViewImageActivity;
|
||||
import ml.docilealligator.infinityforreddit.Activity.ViewMessageActivity;
|
||||
@ -152,4 +153,6 @@ public interface AppComponent {
|
||||
void inject(SidebarFragment sidebarFragment);
|
||||
|
||||
void inject(AdvancedPreferenceFragment advancedPreferenceFragment);
|
||||
|
||||
void inject(ThemePreviewActivity themePreviewActivity);
|
||||
}
|
||||
|
@ -0,0 +1,93 @@
|
||||
package ml.docilealligator.infinityforreddit.Fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import ml.docilealligator.infinityforreddit.Activity.ThemePreviewActivity;
|
||||
import ml.docilealligator.infinityforreddit.CustomTheme.CustomTheme;
|
||||
import ml.docilealligator.infinityforreddit.R;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
*/
|
||||
public class ThemePreviewCommentsFragment extends Fragment {
|
||||
|
||||
@BindView(R.id.linear_layout_theme_preview_comments_fragment)
|
||||
LinearLayout linearLayout;
|
||||
@BindView(R.id.vertical_block_theme_preview_comments_fragment)
|
||||
View verticalBlock;
|
||||
@BindView(R.id.author_type_image_view_theme_preview_comments_fragment)
|
||||
ImageView authorTypeImageView;
|
||||
@BindView(R.id.author_text_view_theme_preview_comments_fragment)
|
||||
TextView authorTextView;
|
||||
@BindView(R.id.author_flair_text_view_theme_preview_comments_fragment)
|
||||
TextView flairTextView;
|
||||
@BindView(R.id.comment_time_text_view_theme_preview_comments_fragment)
|
||||
TextView commentTimeTextView;
|
||||
@BindView(R.id.comment_markdown_view_theme_preview_comments_fragment)
|
||||
TextView contentTextView;
|
||||
@BindView(R.id.up_vote_button_theme_preview_comments_fragment)
|
||||
ImageView upvoteButton;
|
||||
@BindView(R.id.score_text_view_theme_preview_comments_fragment)
|
||||
TextView scoreTextView;
|
||||
@BindView(R.id.down_vote_button_theme_preview_comments_fragment)
|
||||
ImageView downvoteButton;
|
||||
@BindView(R.id.more_button_theme_preview_comments_fragment)
|
||||
ImageView moreButton;
|
||||
@BindView(R.id.expand_button_theme_preview_comments_fragment)
|
||||
ImageView expandButton;
|
||||
@BindView(R.id.save_button_theme_preview_comments_fragment)
|
||||
ImageView saveButton;
|
||||
@BindView(R.id.reply_button_theme_preview_comments_fragment)
|
||||
ImageView replyButton;
|
||||
@BindView(R.id.divider_theme_preview_comments_fragment)
|
||||
View divider;
|
||||
private ThemePreviewActivity activity;
|
||||
|
||||
public ThemePreviewCommentsFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.fragment_theme_preview_comments, container, false);
|
||||
ButterKnife.bind(this, rootView);
|
||||
|
||||
CustomTheme customTheme = activity.getCustomTheme();
|
||||
linearLayout.setBackgroundColor(customTheme.commentBackgroundColor);
|
||||
authorTypeImageView.setColorFilter(customTheme.moderator, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
authorTextView.setTextColor(customTheme.moderator);
|
||||
commentTimeTextView.setTextColor(customTheme.secondaryTextColor);
|
||||
contentTextView.setTextColor(customTheme.commentColor);
|
||||
flairTextView.setTextColor(customTheme.authorFlairTextColor);
|
||||
divider.setBackgroundColor(customTheme.dividerColor);
|
||||
upvoteButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
scoreTextView.setTextColor(customTheme.commentIconAndInfoColor);
|
||||
downvoteButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
moreButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
expandButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
saveButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
replyButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
activity = (ThemePreviewActivity) context;
|
||||
}
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
package ml.docilealligator.infinityforreddit.Fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.libRG.CustomTextView;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
|
||||
import ml.docilealligator.infinityforreddit.Activity.ThemePreviewActivity;
|
||||
import ml.docilealligator.infinityforreddit.CustomTheme.CustomTheme;
|
||||
import ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView;
|
||||
import ml.docilealligator.infinityforreddit.R;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
*/
|
||||
public class ThemePreviewPostsFragment extends Fragment {
|
||||
|
||||
@BindView(R.id.card_view_theme_preview_posts_fragment)
|
||||
CardView cardView;
|
||||
@BindView(R.id.icon_gif_image_view_theme_preview_posts_fragment)
|
||||
AspectRatioGifImageView iconImageView;
|
||||
@BindView(R.id.subreddit_name_text_view_theme_preview_posts_fragment)
|
||||
TextView subredditNameTextView;
|
||||
@BindView(R.id.user_text_view_theme_preview_posts_fragment)
|
||||
TextView usernameTextView;
|
||||
@BindView(R.id.stickied_post_image_view_theme_preview_posts_fragment)
|
||||
ImageView stickiedPostImageView;
|
||||
@BindView(R.id.post_time_text_view_best_theme_preview_posts_fragment)
|
||||
TextView postTimeTextView;
|
||||
@BindView(R.id.title_text_view_best_theme_preview_posts_fragment)
|
||||
TextView titleTextView;
|
||||
@BindView(R.id.content_text_view_theme_preview_posts_fragment)
|
||||
TextView contentTextView;
|
||||
@BindView(R.id.type_text_view_theme_preview_posts_fragment)
|
||||
CustomTextView typeTextView;
|
||||
@BindView(R.id.spoiler_custom_text_view_theme_preview_posts_fragment)
|
||||
CustomTextView spoilerTextView;
|
||||
@BindView(R.id.nsfw_text_view_theme_preview_posts_fragment)
|
||||
CustomTextView nsfwTextView;
|
||||
@BindView(R.id.flair_custom_text_view_theme_preview_posts_fragment)
|
||||
CustomTextView flairTextView;
|
||||
@BindView(R.id.archived_image_view_theme_preview_posts_fragment)
|
||||
ImageView archivedImageView;
|
||||
@BindView(R.id.locked_image_view_theme_preview_posts_fragment)
|
||||
ImageView lockedImageView;
|
||||
@BindView(R.id.crosspost_image_view_theme_preview_posts_fragment)
|
||||
ImageView crosspostImageView;
|
||||
@BindView(R.id.link_text_view_theme_preview_posts_fragment)
|
||||
TextView linkTextView;
|
||||
@BindView(R.id.progress_bar_theme_preview_posts_fragment)
|
||||
ProgressBar progressBar;
|
||||
@BindView(R.id.image_view_no_preview_link_theme_preview_posts_fragment)
|
||||
ImageView noPreviewLinkImageView;
|
||||
@BindView(R.id.plus_button_theme_preview_posts_fragment)
|
||||
ImageView upvoteButton;
|
||||
@BindView(R.id.score_text_view_theme_preview_posts_fragment)
|
||||
TextView scoreTextView;
|
||||
@BindView(R.id.minus_button_theme_preview_posts_fragment)
|
||||
ImageView downvoteButton;
|
||||
@BindView(R.id.comments_count_theme_preview_posts_fragment)
|
||||
TextView commentsCountTextView;
|
||||
@BindView(R.id.save_button_theme_preview_posts_fragment)
|
||||
ImageView saveButton;
|
||||
@BindView(R.id.share_button_theme_preview_posts_fragment)
|
||||
ImageView shareButton;
|
||||
private ThemePreviewActivity activity;
|
||||
|
||||
public ThemePreviewPostsFragment() {
|
||||
// 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_theme_preview_posts, container, false);
|
||||
ButterKnife.bind(this, rootView);
|
||||
|
||||
CustomTheme customTheme = activity.getCustomTheme();
|
||||
|
||||
cardView.setBackgroundTintList(ColorStateList.valueOf(customTheme.cardViewBackgroundColor));
|
||||
Glide.with(this).load(R.drawable.subreddit_default_icon)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||
.into(iconImageView);
|
||||
subredditNameTextView.setTextColor(customTheme.subreddit);
|
||||
usernameTextView.setTextColor(customTheme.username);
|
||||
postTimeTextView.setTextColor(customTheme.secondaryTextColor);
|
||||
titleTextView.setTextColor(customTheme.postTitleColor);
|
||||
contentTextView.setTextColor(customTheme.postContentColor);
|
||||
stickiedPostImageView.setColorFilter(customTheme.stickiedPostIconTint, PorterDuff.Mode.SRC_IN);
|
||||
typeTextView.setBackgroundColor(customTheme.postTypeBackgroundColor);
|
||||
typeTextView.setBorderColor(customTheme.postTypeBackgroundColor);
|
||||
typeTextView.setTextColor(customTheme.postTypeTextColor);
|
||||
spoilerTextView.setBackgroundColor(customTheme.spoilerBackgroundColor);
|
||||
spoilerTextView.setBorderColor(customTheme.spoilerBackgroundColor);
|
||||
spoilerTextView.setTextColor(customTheme.spoilerTextColor);
|
||||
nsfwTextView.setBackgroundColor(customTheme.nsfwBackgroundColor);
|
||||
nsfwTextView.setBorderColor(customTheme.nsfwBackgroundColor);
|
||||
nsfwTextView.setTextColor(customTheme.nsfwTextColor);
|
||||
flairTextView.setBackgroundColor(customTheme.flairBackgroundColor);
|
||||
flairTextView.setBorderColor(customTheme.flairBackgroundColor);
|
||||
flairTextView.setTextColor(customTheme.flairTextColor);
|
||||
archivedImageView.setColorFilter(customTheme.archivedTint, PorterDuff.Mode.SRC_IN);
|
||||
lockedImageView.setColorFilter(customTheme.lockedIconTint, PorterDuff.Mode.SRC_IN);
|
||||
crosspostImageView.setColorFilter(customTheme.crosspostIconTint, PorterDuff.Mode.SRC_IN);
|
||||
linkTextView.setTextColor(customTheme.secondaryTextColor);
|
||||
progressBar.setIndeterminateTintList(ColorStateList.valueOf(customTheme.colorAccent));
|
||||
noPreviewLinkImageView.setBackgroundColor(customTheme.noPreviewLinkBackgroundColor);
|
||||
upvoteButton.setColorFilter(customTheme.postIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
scoreTextView.setTextColor(customTheme.postIconAndInfoColor);
|
||||
downvoteButton.setColorFilter(customTheme.postIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
commentsCountTextView.setTextColor(customTheme.postIconAndInfoColor);
|
||||
Drawable commentIcon = activity.getDrawable(R.drawable.ic_comment_grey_24dp);
|
||||
if (commentIcon != null) {
|
||||
DrawableCompat.setTint(commentIcon, customTheme.postIconAndInfoColor);
|
||||
}
|
||||
commentsCountTextView.setCompoundDrawablesWithIntrinsicBounds(commentIcon, null, null, null);
|
||||
saveButton.setColorFilter(customTheme.postIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
shareButton.setColorFilter(customTheme.postIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
activity = (ThemePreviewActivity) context;
|
||||
}
|
||||
}
|
9
app/src/main/res/drawable/ic_preview_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_preview_24dp.xml
Normal 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="M12,6.5c3.79,0 7.17,2.13 8.82,5.5 -1.65,3.37 -5.02,5.5 -8.82,5.5S4.83,15.37 3.18,12C4.83,8.63 8.21,6.5 12,6.5m0,-2C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,9.5c1.38,0 2.5,1.12 2.5,2.5s-1.12,2.5 -2.5,2.5 -2.5,-1.12 -2.5,-2.5 1.12,-2.5 2.5,-2.5m0,-2c-2.48,0 -4.5,2.02 -4.5,4.5s2.02,4.5 4.5,4.5 4.5,-2.02 4.5,-4.5 -2.02,-4.5 -4.5,-4.5z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
204
app/src/main/res/layout/activity_theme_preview.xml
Normal file
204
app/src/main/res/layout/activity_theme_preview.xml
Normal file
@ -0,0 +1,204 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/coordinator_layout_theme_preview_activity"
|
||||
tools:context=".Activity.ThemePreviewActivity">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager_theme_preview_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar_layout_theme_preview_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsing_toolbar_layout_theme_preview_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:titleEnabled="false"
|
||||
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
|
||||
app:toolbarId="@+id/toolbar">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/toolbar_linear_layout_theme_preview_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="180dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subreddit_name_text_view_theme_preview_activity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/subreddit_preview"
|
||||
android:textSize="?attr/font_18"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name_text_view_theme_preview_activity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/username_preview"
|
||||
android:textSize="?attr/font_18"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/subscribe_subreddit_chip_theme_preview_activity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/subscribe"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/primary_text_text_view_theme_preview_activity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/primary_text_preview"
|
||||
android:textSize="?attr/font_default" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/secondary_text_text_view_theme_preview_activity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end"
|
||||
android:text="@string/secondary_text_preview"
|
||||
android:textSize="?attr/font_default" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:layout_collapseMode="pin"
|
||||
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
app:navigationIcon="?attr/homeAsUpIndicator" />
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout_theme_preview_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed"
|
||||
app:tabIndicatorHeight="3dp"
|
||||
app:tabRippleColor="?attr/colorControlHighlight"
|
||||
app:tabUnboundedRipple="false" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<com.google.android.material.bottomappbar.BottomAppBar
|
||||
android:id="@+id/bottom_navigation_theme_preview_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
app:fabAlignmentMode="center">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_layout_bottom_app_bar_theme_preview_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:weightSum="5">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/subscriptions_bottom_app_bar_theme_preview_activity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:src="@drawable/ic_subscritptions_bottom_app_bar_24dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/multi_reddit_bottom_app_bar_theme_preview_activity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:src="@drawable/ic_multi_reddit_24dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/transparent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/message_bottom_app_bar_theme_preview_activity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:src="@drawable/ic_inbox_24dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profile_bottom_app_bar_theme_preview_activity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_account_circle_24dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.google.android.material.bottomappbar.BottomAppBar>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_theme_preview_activity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/ic_add_day_night_24dp"
|
||||
app:tint="@android:color/white"
|
||||
app:layout_anchor="@id/bottom_navigation_theme_preview_activity" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
@ -15,7 +15,7 @@
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar_layout_view_subreddit_detail"
|
||||
android:id="@+id/appbar_layout_view_subreddit_detail_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/toolbarAndTabBackgroundColor"
|
||||
|
220
app/src/main/res/layout/fragment_theme_preview_comments.xml
Normal file
220
app/src/main/res/layout/fragment_theme_preview_comments.xml
Normal file
@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:context=".Fragment.ThemePreviewCommentsFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_layout_theme_preview_comments_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:id="@+id/vertical_block_theme_preview_comments_fragment"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/author_type_image_view_theme_preview_comments_fragment"
|
||||
android:layout_width="?attr/font_default"
|
||||
android:layout_height="?attr/font_default"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@drawable/ic_mic_14dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/author_flair_text_view_theme_preview_comments_fragment"
|
||||
app:layout_constraintEnd_toStartOf="@id/author_text_view_theme_preview_comments_fragment"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/author_text_view_theme_preview_comments_fragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@string/username_preview"
|
||||
android:textSize="?attr/font_default"
|
||||
app:layout_constraintBottom_toTopOf="@id/author_flair_text_view_theme_preview_comments_fragment"
|
||||
app:layout_constraintEnd_toStartOf="@+id/comment_time_text_view_theme_preview_comments_fragment"
|
||||
app:layout_constraintStart_toEndOf="@id/author_type_image_view_theme_preview_comments_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/author_flair_text_view_theme_preview_comments_fragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@string/author_flair_preview"
|
||||
android:textSize="?attr/font_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/comment_time_text_view_theme_preview_comments_fragment"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/author_text_view_theme_preview_comments_fragment" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comment_time_text_view_theme_preview_comments_fragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:text="2 Hours"
|
||||
android:textSize="?attr/font_default"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comment_markdown_view_theme_preview_comments_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/comment_content_preview"
|
||||
android:textSize="?attr/content_font_default" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bottom_constraint_layout_theme_preview_comments_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/up_vote_button_theme_preview_comments_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/ic_arrow_upward_grey_24dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/score_text_view_theme_preview_comments_fragment"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="1234"
|
||||
android:textSize="?attr/font_12"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/up_vote_button_theme_preview_comments_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/down_vote_button_theme_preview_comments_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/ic_arrow_downward_grey_24dp"
|
||||
android:tint="@android:color/tab_indicator_text"
|
||||
app:layout_constraintStart_toEndOf="@+id/score_text_view_theme_preview_comments_fragment"
|
||||
app:layout_constraintEnd_toStartOf="@id/more_button_theme_preview_comments_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/more_button_theme_preview_comments_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/ic_more_vert_grey_24dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/expand_button_theme_preview_comments_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/expand_button_theme_preview_comments_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/ic_expand_less_grey_24dp"
|
||||
android:tint="@android:color/tab_indicator_text"
|
||||
app:layout_constraintEnd_toStartOf="@+id/save_button_theme_preview_comments_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/save_button_theme_preview_comments_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/ic_bookmark_border_grey_24dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/reply_button_theme_preview_comments_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/reply_button_theme_preview_comments_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/ic_reply_grey_24dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_theme_preview_comments_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
321
app/src/main/res/layout/fragment_theme_preview_posts.xml
Normal file
321
app/src/main/res/layout/fragment_theme_preview_posts.xml
Normal file
@ -0,0 +1,321 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card_view_theme_preview_posts_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp">
|
||||
|
||||
<ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
|
||||
android:id="@+id/icon_gif_image_view_theme_preview_posts_fragment"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subreddit_name_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/subreddit_preview"
|
||||
android:textSize="?attr/font_default"
|
||||
app:layout_constraintBottom_toTopOf="@id/user_text_view_theme_preview_posts_fragment"
|
||||
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_theme_preview_posts_fragment"
|
||||
app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_theme_preview_posts_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@string/username_preview"
|
||||
android:textSize="?attr/font_default"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_theme_preview_posts_fragment"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_theme_preview_posts_fragment"
|
||||
app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_theme_preview_posts_fragment" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/stickied_post_image_view_theme_preview_posts_fragment"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline2"
|
||||
app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_theme_preview_posts_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/post_time_text_view_best_theme_preview_posts_fragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:text="2 Hours"
|
||||
android:textSize="?attr/font_default"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline2"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.6" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text_view_best_theme_preview_posts_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/post_title_preview"
|
||||
android:textSize="?attr/title_font_18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:maxLines="4"
|
||||
android:text="@string/post_content_preview"
|
||||
android:textSize="?attr/content_font_default"
|
||||
android:ellipsize="end" />
|
||||
|
||||
<com.nex3z.flowlayout.FlowLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
app:flChildSpacing="16dp"
|
||||
app:flChildSpacingForLastRow="align"
|
||||
app:flRowSpacing="8dp">
|
||||
|
||||
<com.libRG.CustomTextView
|
||||
android:id="@+id/type_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="4dp"
|
||||
android:text="@string/post_type_preview"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="?attr/font_12"
|
||||
app:lib_setRadius="3dp"
|
||||
app:lib_setRoundedView="true"
|
||||
app:lib_setShape="rectangle" />
|
||||
|
||||
<com.libRG.CustomTextView
|
||||
android:id="@+id/spoiler_custom_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="@string/spoiler"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="?attr/font_12"
|
||||
app:lib_setRadius="3dp"
|
||||
app:lib_setRoundedView="true"
|
||||
app:lib_setShape="rectangle" />
|
||||
|
||||
<com.libRG.CustomTextView
|
||||
android:id="@+id/nsfw_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="4dp"
|
||||
android:text="@string/nsfw"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="?attr/font_12"
|
||||
app:lib_setRadius="3dp"
|
||||
app:lib_setRoundedView="true"
|
||||
app:lib_setShape="rectangle" />
|
||||
|
||||
<com.libRG.CustomTextView
|
||||
android:id="@+id/flair_custom_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="@string/flair_preview"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="?attr/font_12"
|
||||
app:lib_setRadius="3dp"
|
||||
app:lib_setRoundedView="true"
|
||||
app:lib_setShape="rectangle" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/gold"
|
||||
android:drawablePadding="4dp"
|
||||
android:text="@string/gilded_preview"
|
||||
android:textColor="@color/gold"
|
||||
android:textSize="?attr/font_default" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/archived_image_view_theme_preview_posts_fragment"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_archive_outline" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/locked_image_view_theme_preview_posts_fragment"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_outline_lock_24dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/crosspost_image_view_theme_preview_posts_fragment"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/crosspost" />
|
||||
|
||||
</com.nex3z.flowlayout.FlowLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/link_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="abcd.efg"
|
||||
android:textSize="?attr/font_12" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_view_no_preview_link_theme_preview_posts_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_link"
|
||||
android:tint="@android:color/tab_indicator_text"
|
||||
android:background="?attr/noPreviewLinkBackgroundColor" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/plus_button_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_arrow_upward_grey_24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/score_text_view_theme_preview_posts_fragment"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="1234"
|
||||
android:textSize="?attr/font_12"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/plus_button_theme_preview_posts_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/minus_button_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_arrow_downward_grey_24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/score_text_view_theme_preview_posts_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comments_count_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_comment_grey_24dp"
|
||||
android:drawablePadding="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="12dp"
|
||||
android:text="567"
|
||||
android:textSize="?attr/font_12"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/minus_button_theme_preview_posts_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/save_button_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_bookmark_border_grey_24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/share_button_theme_preview_posts_fragment"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constraintStart_toEndOf="@id/comments_count_theme_preview_posts_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share_button_theme_preview_posts_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?actionBarItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_share_grey_24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
@ -2,9 +2,16 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_save_customize_theme_activity"
|
||||
android:id="@+id/action_preview_customize_theme_activity"
|
||||
android:orderInCategory="1"
|
||||
android:title="@string/action_save"
|
||||
android:icon="@drawable/ic_preview_24dp"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_save_customize_theme_activity"
|
||||
android:orderInCategory="2"
|
||||
android:title="@string/action_save"
|
||||
android:icon="@drawable/ic_check_circle_toolbar_24dp"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
@ -22,6 +22,7 @@
|
||||
<string name="custom_theme_listing_activity_label">Custom Themes</string>
|
||||
<string name="customize_theme_activity_label">Customize Theme</string>
|
||||
<string name="customize_theme_activity_create_theme_label">Create Theme</string>
|
||||
<string name="theme_preview_activity_label">Theme Preview</string>
|
||||
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||
@ -658,5 +659,17 @@
|
||||
<string name="delete_all_themes_success">Delete all themes successful</string>
|
||||
<string name="reset_all_settings_success">Reset all settings successful</string>
|
||||
|
||||
<string name="theme_preview">Theme Preview</string>
|
||||
<string name="username_preview">u/Hostilenemy</string>
|
||||
<string name="subreddit_preview">r/Infinity_For_Reddit</string>
|
||||
<string name="primary_text_preview">Primary Text</string>
|
||||
<string name="secondary_text_preview">Secondary Text</string>
|
||||
<string name="post_title_preview">This is a post</string>
|
||||
<string name="post_content_preview">This gravity joke is getting a bit old, but I fall for it every time.</string>
|
||||
<string name="post_type_preview">POST</string>
|
||||
<string name="flair_preview">Flair</string>
|
||||
<string name="gilded_preview">x4</string>
|
||||
<string name="author_flair_preview">Author Flair</string>
|
||||
<string name="comment_content_preview">I got my girlfriend a “Get better soon” card.\nShe\'s not ill or anything, but she could definitely get better.</string>
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user