diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-08-29 06:08:32 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-08-29 06:08:32 +0000 |
commit | eff076a27014f0315151a68cd7f1659d1f9cf1cd (patch) | |
tree | fd75d58bee1c0351d908383b1e4621746a8ea980 /app/src/main/java | |
parent | c5a824ac89af99017b95b0806b700f0428e198e3 (diff) | |
download | infinity-for-reddit-eff076a27014f0315151a68cd7f1659d1f9cf1cd.tar infinity-for-reddit-eff076a27014f0315151a68cd7f1659d1f9cf1cd.tar.gz infinity-for-reddit-eff076a27014f0315151a68cd7f1659d1f9cf1cd.tar.bz2 infinity-for-reddit-eff076a27014f0315151a68cd7f1659d1f9cf1cd.tar.lz infinity-for-reddit-eff076a27014f0315151a68cd7f1659d1f9cf1cd.tar.xz infinity-for-reddit-eff076a27014f0315151a68cd7f1659d1f9cf1cd.tar.zst infinity-for-reddit-eff076a27014f0315151a68cd7f1659d1f9cf1cd.zip |
Fixed controller position and margin in ViewVideoActivity. Minor UI tweaks.
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java | 10 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java | 20 |
2 files changed, 21 insertions, 9 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java index 23b24de2..b2c0e12a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java @@ -325,12 +325,13 @@ public class PostFragment extends Fragment implements FragmentCommunicator { filter, nsfw); } } else if(postType == PostDataSource.TYPE_USER) { - CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) mFetchPostInfoLinearLayout.getLayoutParams(); - params.height = ViewGroup.LayoutParams.WRAP_CONTENT; - mFetchPostInfoLinearLayout.setLayoutParams(params); - String username = getArguments().getString(EXTRA_USER_NAME); String where = getArguments().getString(EXTRA_USER_WHERE); + if(where != null && where.equals(PostDataSource.USER_WHERE_SUBMITTED)) { + CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) mFetchPostInfoLinearLayout.getLayoutParams(); + params.height = ViewGroup.LayoutParams.WRAP_CONTENT; + mFetchPostInfoLinearLayout.setLayoutParams(params); + } mAdapter = new PostRecyclerViewAdapter(activity, mOauthRetrofit, mRetrofit, mRedditDataRoomDatabase, accessToken, postType, true, new PostRecyclerViewAdapter.Callback() { @@ -404,6 +405,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { this.hasPost = hasPost; if(hasPost) { mFetchPostInfoLinearLayout.setVisibility(View.GONE); + mProgressBar.setVisibility(View.GONE); } else { if(isInLazyMode) { stopLazyMode(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java index bffc0a9c..c3ed9951 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java @@ -8,6 +8,7 @@ import android.app.DownloadManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; +import android.content.res.Configuration; import android.graphics.PorterDuff; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; @@ -94,11 +95,20 @@ public class ViewVideoActivity extends AppCompatActivity { actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarColor))); setTitle(""); - //Set player controller margin bottom in order to display it above the navbar - int resourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android"); - LinearLayout controllerLinearLayout = findViewById(R.id.linear_layout_exo_playback_control_view); - ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) controllerLinearLayout.getLayoutParams(); - params.bottomMargin = getResources().getDimensionPixelSize(resourceId); + + if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT || getResources().getBoolean(R.bool.isTablet)) { + //Set player controller bottom margin in order to display it above the navbar + int resourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android"); + LinearLayout controllerLinearLayout = findViewById(R.id.linear_layout_exo_playback_control_view); + ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) controllerLinearLayout.getLayoutParams(); + params.bottomMargin = getResources().getDimensionPixelSize(resourceId); + } else { + //Set player controller right margin in order to display it above the navbar + int resourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android"); + LinearLayout controllerLinearLayout = findViewById(R.id.linear_layout_exo_playback_control_view); + ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) controllerLinearLayout.getLayoutParams(); + params.rightMargin = getResources().getDimensionPixelSize(resourceId); + } Intent intent = getIntent(); mVideoUri = intent.getData(); |