mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
Minor UI tweaks in ViewSubredditDetailActivity, ViewUserDetailActivity and CustomThemePreviewActivity.
This commit is contained in:
parent
318240e271
commit
9614f4a67a
@ -187,7 +187,7 @@
|
|||||||
android:name=".activities.CustomThemePreviewActivity"
|
android:name=".activities.CustomThemePreviewActivity"
|
||||||
android:label="@string/theme_preview_activity_label"
|
android:label="@string/theme_preview_activity_label"
|
||||||
android:parentActivityName=".activities.MainActivity"
|
android:parentActivityName=".activities.MainActivity"
|
||||||
android:theme="@style/AppTheme.SlidableWithTranslucentWindow" />
|
android:theme="@style/AppTheme.Slidable" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.CustomThemeListingActivity"
|
android:name=".activities.CustomThemeListingActivity"
|
||||||
android:label="@string/custom_theme_listing_activity_label"
|
android:label="@string/custom_theme_listing_activity_label"
|
||||||
@ -411,11 +411,11 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".activities.ViewSubredditDetailActivity"
|
android:name=".activities.ViewSubredditDetailActivity"
|
||||||
android:parentActivityName=".activities.MainActivity"
|
android:parentActivityName=".activities.MainActivity"
|
||||||
android:theme="@style/AppTheme.SlidableWithTranslucentWindow" />
|
android:theme="@style/AppTheme.Slidable" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ViewUserDetailActivity"
|
android:name=".activities.ViewUserDetailActivity"
|
||||||
android:parentActivityName=".activities.MainActivity"
|
android:parentActivityName=".activities.MainActivity"
|
||||||
android:theme="@style/AppTheme.SlidableWithTranslucentWindow" />
|
android:theme="@style/AppTheme.Slidable" />
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
@ -16,6 +16,7 @@ import android.util.TypedValue;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@ -80,6 +81,8 @@ public class CustomThemePreviewActivity extends AppCompatActivity implements Cus
|
|||||||
CollapsingToolbarLayout collapsingToolbarLayout;
|
CollapsingToolbarLayout collapsingToolbarLayout;
|
||||||
@BindView(R.id.toolbar_linear_layout_theme_preview_activity)
|
@BindView(R.id.toolbar_linear_layout_theme_preview_activity)
|
||||||
LinearLayout linearLayout;
|
LinearLayout linearLayout;
|
||||||
|
@BindView(R.id.extra_padding_view_theme_preview_activity)
|
||||||
|
View extraPaddingView;
|
||||||
@BindView(R.id.subreddit_name_text_view_theme_preview_activity)
|
@BindView(R.id.subreddit_name_text_view_theme_preview_activity)
|
||||||
TextView subredditNameTextView;
|
TextView subredditNameTextView;
|
||||||
@BindView(R.id.user_name_text_view_theme_preview_activity)
|
@BindView(R.id.user_name_text_view_theme_preview_activity)
|
||||||
@ -239,6 +242,7 @@ public class CustomThemePreviewActivity extends AppCompatActivity implements Cus
|
|||||||
} else {
|
} else {
|
||||||
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
||||||
}
|
}
|
||||||
|
adjustToolbar(toolbar);
|
||||||
|
|
||||||
Resources resources = getResources();
|
Resources resources = getResources();
|
||||||
int navBarResourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
int navBarResourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||||
@ -304,7 +308,6 @@ public class CustomThemePreviewActivity extends AppCompatActivity implements Cus
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
adjustToolbar(toolbar);
|
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
subscribeSubredditChip.setOnClickListener(view -> {
|
subscribeSubredditChip.setOnClickListener(view -> {
|
||||||
@ -335,6 +338,13 @@ public class CustomThemePreviewActivity extends AppCompatActivity implements Cus
|
|||||||
|
|
||||||
private void applyCustomTheme() {
|
private void applyCustomTheme() {
|
||||||
coordinatorLayout.setBackgroundColor(customTheme.backgroundColor);
|
coordinatorLayout.setBackgroundColor(customTheme.backgroundColor);
|
||||||
|
appBarLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
|
@Override
|
||||||
|
public void onGlobalLayout() {
|
||||||
|
appBarLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||||
|
collapsingToolbarLayout.setScrimVisibleHeightTrigger(toolbar.getHeight() + tabLayout.getHeight() + getStatusBarHeight() * 2);
|
||||||
|
}
|
||||||
|
});
|
||||||
collapsingToolbarLayout.setContentScrimColor(customTheme.colorPrimary);
|
collapsingToolbarLayout.setContentScrimColor(customTheme.colorPrimary);
|
||||||
subscribeSubredditChip.setTextColor(customTheme.chipTextColor);
|
subscribeSubredditChip.setTextColor(customTheme.chipTextColor);
|
||||||
subscribeSubredditChip.setChipBackgroundColor(ColorStateList.valueOf(customTheme.unsubscribed));
|
subscribeSubredditChip.setChipBackgroundColor(ColorStateList.valueOf(customTheme.unsubscribed));
|
||||||
@ -346,6 +356,7 @@ public class CustomThemePreviewActivity extends AppCompatActivity implements Cus
|
|||||||
collapsedTabIndicatorColor = customTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator;
|
collapsedTabIndicatorColor = customTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator;
|
||||||
collapsedTabBackgroundColor = customTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground;
|
collapsedTabBackgroundColor = customTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground;
|
||||||
linearLayout.setBackgroundColor(customTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground);
|
linearLayout.setBackgroundColor(customTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground);
|
||||||
|
extraPaddingView.setBackgroundColor(customTheme.colorPrimary);
|
||||||
subredditNameTextView.setTextColor(customTheme.subreddit);
|
subredditNameTextView.setTextColor(customTheme.subreddit);
|
||||||
usernameTextView.setTextColor(customTheme.username);
|
usernameTextView.setTextColor(customTheme.username);
|
||||||
subscribeSubredditChip.setTextColor(customTheme.chipTextColor);
|
subscribeSubredditChip.setTextColor(customTheme.chipTextColor);
|
||||||
@ -370,6 +381,15 @@ public class CustomThemePreviewActivity extends AppCompatActivity implements Cus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getStatusBarHeight() {
|
||||||
|
int result = 0;
|
||||||
|
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||||
|
if (resourceId > 0) {
|
||||||
|
result = getResources().getDimensionPixelSize(resourceId);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
protected void applyAppBarLayoutAndToolbarTheme(AppBarLayout appBarLayout, Toolbar toolbar) {
|
protected void applyAppBarLayoutAndToolbarTheme(AppBarLayout appBarLayout, Toolbar toolbar) {
|
||||||
appBarLayout.setBackgroundColor(customTheme.colorPrimary);
|
appBarLayout.setBackgroundColor(customTheme.colorPrimary);
|
||||||
toolbar.setTitleTextColor(customTheme.toolbarPrimaryTextAndIconColor);
|
toolbar.setTitleTextColor(customTheme.toolbarPrimaryTextAndIconColor);
|
||||||
|
@ -236,7 +236,6 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
((Infinity) getApplication()).getAppComponent().inject(this);
|
((Infinity) getApplication()).getAppComponent().inject(this);
|
||||||
setTransparentStatusBarAfterToolbarCollapsed();
|
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
@ -268,6 +267,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
} else {
|
} else {
|
||||||
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
||||||
}
|
}
|
||||||
|
adjustToolbar(toolbar);
|
||||||
|
|
||||||
int navBarHeight = getNavBarHeight();
|
int navBarHeight = getNavBarHeight();
|
||||||
if (navBarHeight > 0) {
|
if (navBarHeight > 0) {
|
||||||
@ -364,7 +364,6 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
subredditNameTextView.setText(title);
|
subredditNameTextView.setText(title);
|
||||||
|
|
||||||
toolbar.setTitle(title);
|
toolbar.setTitle(title);
|
||||||
adjustToolbar(toolbar);
|
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
setToolbarGoToTop(toolbar);
|
setToolbarGoToTop(toolbar);
|
||||||
|
|
||||||
@ -537,7 +536,6 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
creationTimeTextView.setTextColor(primaryTextColor);
|
creationTimeTextView.setTextColor(primaryTextColor);
|
||||||
descriptionTextView.setTextColor(primaryTextColor);
|
descriptionTextView.setTextColor(primaryTextColor);
|
||||||
navigationWrapper.applyCustomTheme(mCustomThemeWrapper.getBottomAppBarIconColor(), mCustomThemeWrapper.getBottomAppBarBackgroundColor());
|
navigationWrapper.applyCustomTheme(mCustomThemeWrapper.getBottomAppBarIconColor(), mCustomThemeWrapper.getBottomAppBarBackgroundColor());
|
||||||
int bottomAppBarIconColor = mCustomThemeWrapper.getBottomAppBarIconColor();
|
|
||||||
applyTabLayoutTheme(tabLayout);
|
applyTabLayoutTheme(tabLayout);
|
||||||
applyFABTheme(navigationWrapper.floatingActionButton);
|
applyFABTheme(navigationWrapper.floatingActionButton);
|
||||||
if (typeface != null) {
|
if (typeface != null) {
|
||||||
|
@ -286,8 +286,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
|||||||
|
|
||||||
Resources resources = getResources();
|
Resources resources = getResources();
|
||||||
|
|
||||||
adjustToolbar(toolbar);
|
|
||||||
|
|
||||||
String title = "u/" + username;
|
String title = "u/" + username;
|
||||||
userNameTextView.setText(title);
|
userNameTextView.setText(title);
|
||||||
toolbar.setTitle(title);
|
toolbar.setTitle(title);
|
||||||
@ -304,6 +302,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
|||||||
} else {
|
} else {
|
||||||
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
||||||
}
|
}
|
||||||
|
adjustToolbar(toolbar);
|
||||||
|
|
||||||
int navBarHeight = getNavBarHeight();
|
int navBarHeight = getNavBarHeight();
|
||||||
if (navBarHeight > 0) {
|
if (navBarHeight > 0) {
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
android:id="@+id/banner_image_view_view_subreddit_detail_activity"
|
android:id="@+id/banner_image_view_view_subreddit_detail_activity"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:layout_height="180dp"
|
android:layout_height="160dp"
|
||||||
android:contentDescription="@string/content_description_banner_imageview" />
|
android:contentDescription="@string/content_description_banner_imageview" />
|
||||||
|
|
||||||
<pl.droidsonroids.gif.GifImageView
|
<pl.droidsonroids.gif.GifImageView
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
android:id="@+id/banner_image_view_view_user_detail_activity"
|
android:id="@+id/banner_image_view_view_user_detail_activity"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:layout_height="180dp"
|
android:layout_height="160dp"
|
||||||
android:contentDescription="@string/content_description_banner_imageview" />
|
android:contentDescription="@string/content_description_banner_imageview" />
|
||||||
|
|
||||||
<pl.droidsonroids.gif.GifImageView
|
<pl.droidsonroids.gif.GifImageView
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
android:id="@+id/banner_image_view_view_subreddit_detail_activity"
|
android:id="@+id/banner_image_view_view_subreddit_detail_activity"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:layout_height="180dp"
|
android:layout_height="160dp"
|
||||||
android:contentDescription="@string/content_description_banner_imageview" />
|
android:contentDescription="@string/content_description_banner_imageview" />
|
||||||
|
|
||||||
<pl.droidsonroids.gif.GifImageView
|
<pl.droidsonroids.gif.GifImageView
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
android:id="@+id/banner_image_view_view_user_detail_activity"
|
android:id="@+id/banner_image_view_view_user_detail_activity"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:layout_height="180dp"
|
android:layout_height="160dp"
|
||||||
android:contentDescription="@string/content_description_banner_imageview" />
|
android:contentDescription="@string/content_description_banner_imageview" />
|
||||||
|
|
||||||
<pl.droidsonroids.gif.GifImageView
|
<pl.droidsonroids.gif.GifImageView
|
||||||
|
@ -31,14 +31,17 @@
|
|||||||
android:id="@+id/toolbar_linear_layout_theme_preview_activity"
|
android:id="@+id/toolbar_linear_layout_theme_preview_activity"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:paddingTop="16dp"
|
|
||||||
android:paddingStart="16dp"
|
<View
|
||||||
android:paddingEnd="16dp">
|
android:id="@+id/extra_padding_view_theme_preview_activity"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="140dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@ -69,16 +72,19 @@
|
|||||||
android:id="@+id/subscribe_subreddit_chip_theme_preview_activity"
|
android:id="@+id/subscribe_subreddit_chip_theme_preview_activity"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
android:text="@string/subscribe"
|
android:text="@string/subscribe"
|
||||||
android:layout_gravity="center_horizontal"/>
|
app:chipStrokeColor="#00000000" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:paddingBottom="16dp"
|
||||||
android:layout_marginBottom="16dp">
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/primary_text_text_view_theme_preview_activity"
|
android:id="@+id/primary_text_text_view_theme_preview_activity"
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
android:id="@+id/banner_image_view_view_subreddit_detail_activity"
|
android:id="@+id/banner_image_view_view_subreddit_detail_activity"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:layout_height="180dp"
|
android:layout_height="160dp"
|
||||||
android:contentDescription="@string/content_description_banner_imageview" />
|
android:contentDescription="@string/content_description_banner_imageview" />
|
||||||
|
|
||||||
<pl.droidsonroids.gif.GifImageView
|
<pl.droidsonroids.gif.GifImageView
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
android:id="@+id/banner_image_view_view_user_detail_activity"
|
android:id="@+id/banner_image_view_view_user_detail_activity"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:layout_height="180dp"
|
android:layout_height="160dp"
|
||||||
android:contentDescription="@string/content_description_banner_imageview" />
|
android:contentDescription="@string/content_description_banner_imageview" />
|
||||||
|
|
||||||
<pl.droidsonroids.gif.GifImageView
|
<pl.droidsonroids.gif.GifImageView
|
||||||
|
@ -34,10 +34,6 @@
|
|||||||
<item name="android:fontFamily">?attr/font_family</item>
|
<item name="android:fontFamily">?attr/font_family</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.SlidableWithTranslucentWindow" parent="AppTheme.Slidable">
|
|
||||||
<item name="android:windowTranslucentStatus">true</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="AppTheme.Draggable" parent="AppTheme">
|
<style name="AppTheme.Draggable" parent="AppTheme">
|
||||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||||
<item name="android:windowContentOverlay">@null</item>
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user