From d217c2ad0086802ee185d353280c54c2b28633b6 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Wed, 18 Jan 2017 01:07:27 +0200 Subject: [PATCH] In-app link handling fixes, bigger progress bars, FABs and navBar behavior changes, attached files downloading fixes for internal storage. --- app/build.gradle | 4 +- .../activities/board/BoardActivity.java | 8 ++ .../activities/profile/ProfileActivity.java | 21 ++++++ .../activities/topic/TopicActivity.java | 11 ++- .../mthmmy/activities/topic/TopicAdapter.java | 8 +- .../mthmmy/utils/FileManager/ThmmyFile.java | 75 +++++++++++++------ .../gr/thmmy/mthmmy/utils/ParseHelpers.java | 3 + .../mthmmy/utils/ScrollAwareFABBehavior.java | 12 ++- .../utils/ScrollAwareLinearBehavior.java | 19 +++-- .../main/res/layout-v21/activity_profile.xml | 2 +- app/src/main/res/layout/activity_board.xml | 2 +- app/src/main/res/layout/activity_profile.xml | 2 +- app/src/main/res/layout/activity_topic.xml | 2 +- app/src/main/res/layout/fragment_forum.xml | 12 +-- .../main/res/layout/fragment_latest_posts.xml | 2 +- app/src/main/res/layout/fragment_recent.xml | 10 +-- app/src/main/res/layout/fragment_stats.xml | 2 +- app/src/main/res/values-w820dp/dimens.xml | 1 + app/src/main/res/values/dimens.xml | 1 + 19 files changed, 142 insertions(+), 55 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ac5a28c4..aab5c5d6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "gr.thmmy.mthmmy" minSdkVersion 19 targetSdkVersion 25 - versionCode 1 - versionName "1.0.0" + versionCode 2 + versionName "1.0.1" archivesBaseName = "mTHMMY-v$versionName" } diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java index bedc7ed1..9b7071f5 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java @@ -2,6 +2,7 @@ package gr.thmmy.mthmmy.activities.board; import android.content.DialogInterface; import android.content.Intent; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; @@ -28,6 +29,7 @@ import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.activities.LoginActivity; import gr.thmmy.mthmmy.activities.base.BaseActivity; import gr.thmmy.mthmmy.model.Board; +import gr.thmmy.mthmmy.model.LinkTarget; import gr.thmmy.mthmmy.model.Topic; import me.zhanghai.android.materialprogressbar.MaterialProgressBar; import mthmmy.utils.Report; @@ -74,6 +76,12 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo Bundle extras = getIntent().getExtras(); boardTitle = extras.getString(BUNDLE_BOARD_TITLE); boardUrl = extras.getString(BUNDLE_BOARD_URL); + LinkTarget.Target target = LinkTarget.resolveLinkTarget(Uri.parse(boardUrl)); + if (!target.is(LinkTarget.Target.BOARD)) { + Report.e(TAG, "Bundle came with a non board url!\nUrl:\n" + boardUrl); + Toast.makeText(this, "An error has occurred\nAborting.", Toast.LENGTH_SHORT).show(); + finish(); + } //Initializes graphics toolbar = (Toolbar) findViewById(R.id.toolbar); diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java index 5899efae..66e85146 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java @@ -2,6 +2,7 @@ package gr.thmmy.mthmmy.activities.profile; import android.content.DialogInterface; import android.content.Intent; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; @@ -38,6 +39,7 @@ import gr.thmmy.mthmmy.activities.profile.latestPosts.LatestPostsFragment; import gr.thmmy.mthmmy.activities.profile.stats.StatsFragment; import gr.thmmy.mthmmy.activities.profile.summary.SummaryFragment; import gr.thmmy.mthmmy.activities.topic.TopicActivity; +import gr.thmmy.mthmmy.model.LinkTarget; import gr.thmmy.mthmmy.model.PostSummary; import gr.thmmy.mthmmy.utils.CircleTransform; import me.zhanghai.android.materialprogressbar.MaterialProgressBar; @@ -86,6 +88,7 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment private String personalText; private String profileUrl; private String username; + private int tabSelect; @Override protected void onCreate(Bundle savedInstanceState) { @@ -162,6 +165,20 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment }); } + LinkTarget.Target target = LinkTarget.resolveLinkTarget(Uri.parse(profileUrl)); + if (!target.is(LinkTarget.Target.PROFILE)) { + Report.e(TAG, "Bundle came with a non profile url!\nUrl:\n" + profileUrl); + Toast.makeText(this, "An error has occurred\n Aborting.", Toast.LENGTH_SHORT).show(); + finish(); + } + if (target.is(LinkTarget.Target.PROFILE_STATS)) { + profileUrl = profileUrl.substring(0, profileUrl.indexOf(";sa=statPanel")); + tabSelect = 2; + } else if (target.is(LinkTarget.Target.PROFILE_LATEST_POSTS)) { + profileUrl = profileUrl.substring(0, profileUrl.indexOf(";sa=showPosts")); + tabSelect = 1; + } + profileTask = new ProfileTask(); profileTask.execute(profileUrl); //Attempts data parsing } @@ -258,6 +275,10 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment setupViewPager(viewPager, profilePage); TabLayout tabLayout = (TabLayout) findViewById(R.id.profile_tabs); tabLayout.setupWithViewPager(viewPager); + if (tabSelect != 0) { + TabLayout.Tab tab = tabLayout.getTabAt(tabSelect); + if (tab != null) tab.select(); + } } } diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java index c7ca6b73..3943bf0d 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java @@ -2,6 +2,7 @@ package gr.thmmy.mthmmy.activities.topic; import android.content.DialogInterface; import android.content.Intent; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; @@ -28,6 +29,7 @@ import java.util.Objects; import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.activities.LoginActivity; import gr.thmmy.mthmmy.activities.base.BaseActivity; +import gr.thmmy.mthmmy.model.LinkTarget; import gr.thmmy.mthmmy.model.Post; import gr.thmmy.mthmmy.utils.ParseHelpers; import me.zhanghai.android.materialprogressbar.MaterialProgressBar; @@ -99,7 +101,14 @@ public class TopicActivity extends BaseActivity { setContentView(R.layout.activity_topic); Bundle extras = getIntent().getExtras(); - topicTitle = extras.getString("TOPIC_TITLE"); + topicTitle = extras.getString(BUNDLE_TOPIC_TITLE); + LinkTarget.Target target = LinkTarget.resolveLinkTarget( + Uri.parse(extras.getString(BUNDLE_TOPIC_URL))); + if (!target.is(LinkTarget.Target.TOPIC)) { + Report.e(TAG, "Bundle came with a non topic url!\nUrl:\n" + extras.getString(BUNDLE_TOPIC_URL)); + Toast.makeText(this, "An error has occurred\n Aborting.", Toast.LENGTH_SHORT).show(); + finish(); + } //Initializes graphics toolbar = (Toolbar) findViewById(R.id.toolbar); diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java index 7c69d9ef..f44e3a65 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java @@ -16,6 +16,7 @@ import android.support.v4.content.res.ResourcesCompat; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; +import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -632,7 +633,7 @@ class TopicAdapter extends RecyclerView.Adapter { @Override protected String doInBackground(ThmmyFile... files) { try { - File tempFile = files[0].download(); + File tempFile = files[0].download(context); if (tempFile != null) { String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension( files[0].getExtension()); @@ -646,6 +647,9 @@ class TopicAdapter extends RecyclerView.Adapter { } catch (IOException e) { Report.e(TAG, "Error while trying to download a file", e); return e.toString(); + } catch (OutOfMemoryError e) { + Report.e(TAG, "Error while trying to download a file", e); + return e.toString(); } return null; } @@ -654,7 +658,7 @@ class TopicAdapter extends RecyclerView.Adapter { protected void onPostExecute(String result) { mWakeLock.release(); if (result != null) - Toast.makeText(context, "Error! Download not complete.", Toast.LENGTH_SHORT).show(); + Toast.makeText(context, result, Toast.LENGTH_SHORT).show(); else Toast.makeText(context, "Download complete", Toast.LENGTH_SHORT).show(); progressBar.setVisibility(View.INVISIBLE); diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/FileManager/ThmmyFile.java b/app/src/main/java/gr/thmmy/mthmmy/utils/FileManager/ThmmyFile.java index abe8ce9c..c1eb7cfb 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/FileManager/ThmmyFile.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/FileManager/ThmmyFile.java @@ -1,6 +1,8 @@ package gr.thmmy.mthmmy.utils.FileManager; +import android.content.Context; import android.os.Environment; +import android.os.StatFs; import android.support.annotation.Nullable; import android.webkit.MimeTypeMap; @@ -18,10 +20,7 @@ import static gr.thmmy.mthmmy.activities.base.BaseActivity.getClient; /** * Used for downloading and storing a file from the forum using {@link okhttp3}. - *

Class has one constructor:

  • {@link #ThmmyFile(URL, String, String)}
- * and the methods:
  • getters
  • - *
  • {@link #download()}
  • - *
  • {@link #download()}

+ *

Class has one constructor, {@link #ThmmyFile(URL, String, String)}. */ public class ThmmyFile { /** @@ -33,9 +32,22 @@ public class ThmmyFile { private String extension, filePath; private File file; + /** + * This constructor only creates a empty ThmmyFile object and does not download the file. To download + * the file use {@link #download(Context)} after setting file's url! + */ + public ThmmyFile() { + this.fileUrl = null; + this.filename = null; + this.fileInfo = null; + this.extension = null; + this.filePath = null; + this.file = null; + } + /** * This constructor only creates a ThmmyFile object and does not download the file. To download - * the file use {@link #download()} or {@link #download()}! + * the file use {@link #download(Context)}! * * @param fileUrl {@link URL} object with file's url * @param filename {@link String} with desired file name @@ -63,7 +75,7 @@ public class ThmmyFile { } /** - * This is null until {@link #download()} or {@link #download()} is called and has succeeded. + * This is null until {@link #download(Context)} is called and has succeeded. * * @return String with file's extension or null */ @@ -73,7 +85,7 @@ public class ThmmyFile { } /** - * This is null until {@link #download()} or {@link #download()} is called and has succeeded. + * This is null until {@link #download(Context)} is called and has succeeded. * * @return String with file's path or null */ @@ -83,7 +95,7 @@ public class ThmmyFile { } /** - * This is null until {@link #download()} or {@link #download()} is called and has succeeded. + * This is null until {@link #download(Context)} is called and has succeeded. * * @return {@link File} or null */ @@ -112,7 +124,10 @@ public class ThmmyFile { * @throws SecurityException if the requested file is not hosted by the forum. */ @Nullable - public File download() throws IOException, SecurityException { + public File download(Context context) throws IOException, SecurityException, OutOfMemoryError { + if (fileUrl == null) { + return null; + } if (!Objects.equals(fileUrl.getHost(), "www.thmmy.gr")) throw new SecurityException("Downloading files from other sources is not supported"); @@ -122,7 +137,7 @@ public class ThmmyFile { if (!response.isSuccessful()) { throw new IOException("Failed to download file: " + response); } - file = getOutputMediaFile(filename); + file = getOutputMediaFile(context, filename, fileInfo); if (file == null) { Report.d(TAG, "Error creating media file, check storage permissions!"); } else { @@ -138,24 +153,40 @@ public class ThmmyFile { } @Nullable - private static File getOutputMediaFile(String fileName) { - // To be safe, you should check that the SDCard is mounted - // using Environment.getExternalStorageState() before doing this. - File mediaStorageDir = new File(Environment.getExternalStorageDirectory() - + "/Android/data/gr.thmmy.mthmmy/" - + "Downloads/"); - - // This location works best if you want the created files to be shared - // between applications and persist after your app has been uninstalled. + private File getOutputMediaFile(Context context, String fileName, String fileInfo) throws OutOfMemoryError, IOException { + File mediaStorageDir; + String extState = Environment.getExternalStorageState(); + if (Environment.isExternalStorageRemovable() && + Objects.equals(extState, Environment.MEDIA_MOUNTED)) { + mediaStorageDir = new File(Environment.getExternalStorageDirectory() + + "/Android/data/gr.thmmy.mthmmy/" + + "Downloads/"); + } else { + mediaStorageDir = new File(context.getFilesDir(), "Downloads"); + } - // Create the storage directory if it does not exist + //Creates the storage directory if it does not exist if (!mediaStorageDir.exists()) { if (!mediaStorageDir.mkdirs()) { Report.d(TAG, "problem!"); - return null; + throw new IOException("Error.\nCouldn't create the path!"); + } + } + + + if (fileInfo != null) { + if (fileInfo.contains("KB")) { + float fileSize = Float.parseFloat(fileInfo + .substring(fileInfo.indexOf("(") + 1, fileInfo.indexOf("KB") - 1)); + + StatFs stat = new StatFs(mediaStorageDir.getPath()); + long bytesAvailable = stat.getBlockSizeLong() * stat.getAvailableBlocksLong(); + if ((bytesAvailable / 1024.f) < fileSize) + throw new OutOfMemoryError("There is not enough memory!"); } } - // Create a media file name + + //Creates a media file name File mediaFile; mediaFile = new File(mediaStorageDir.getPath() + File.separator + fileName); return mediaFile; diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/ParseHelpers.java b/app/src/main/java/gr/thmmy/mthmmy/utils/ParseHelpers.java index cb0b772c..2520cc89 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/ParseHelpers.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/ParseHelpers.java @@ -119,6 +119,9 @@ public class ParseHelpers { if (warning.text().contains("The topic or board you are looking for appears " + "to be either missing or off limits to you.")) return UNAUTHORIZED_OR_MISSING; + else if (warning.text().contains("Το θέμα ή πίνακας που ψάχνετε ή δεν υπάρχει ή " + + "δεν είναι προσβάσιμο από εσάς. ")) + return UNAUTHORIZED_OR_MISSING; } } return READY; diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareFABBehavior.java b/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareFABBehavior.java index 8c818bc9..58ba1a62 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareFABBehavior.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareFABBehavior.java @@ -12,7 +12,9 @@ import android.view.View; * otherwise. */ @SuppressWarnings("WeakerAccess") -public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior { +public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior { + String TAG = "ScrollAwareFABBehavior"; + @SuppressWarnings("UnusedParameters") public ScrollAwareFABBehavior(Context context, AttributeSet attrs) { super(); @@ -29,8 +31,9 @@ public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior 0 && child.getVisibility() == View.VISIBLE) { + super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed); + if ((dyConsumed > 0 || (!target.canScrollVertically(-1) && dyConsumed == 0 + && dyUnconsumed < 40)) && child.getVisibility() == View.VISIBLE) { child.hide(new FloatingActionButton.OnVisibilityChangedListener() { @Override public void onHidden(FloatingActionButton fab) { @@ -38,7 +41,8 @@ public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior 40)) && child.getVisibility() != View.VISIBLE) { child.show(); } } diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareLinearBehavior.java b/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareLinearBehavior.java index 2c7b051f..6e791204 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareLinearBehavior.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareLinearBehavior.java @@ -6,6 +6,7 @@ import android.support.design.widget.CoordinatorLayout; import android.support.v4.view.ViewCompat; import android.support.v4.view.animation.FastOutSlowInInterpolator; import android.util.AttributeSet; +import android.util.Log; import android.view.View; import android.view.ViewPropertyAnimator; @@ -28,19 +29,22 @@ public class ScrollAwareLinearBehavior extends CoordinatorLayout.Behavior } @Override - public void onNestedScroll (CoordinatorLayout coordinatorLayout, View bottomNavBar, View target, - int dxConsumed, int dyConsumed, - int dxUnconsumed, int dyUnconsumed){ - super.onNestedScroll(coordinatorLayout, bottomNavBar, target, dxConsumed, dyConsumed,dxUnconsumed, dyUnconsumed); - if (dyConsumed > 0 && bottomNavBar.getVisibility() == View.VISIBLE) { + public void onNestedScroll(CoordinatorLayout coordinatorLayout, View bottomNavBar, View target, + int dxConsumed, int dyConsumed, + int dxUnconsumed, int dyUnconsumed) { + super.onNestedScroll(coordinatorLayout, bottomNavBar, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed); + if ((dyConsumed > 0 || (!target.canScrollVertically(-1) && dyConsumed == 0 + && dyUnconsumed < 40)) && bottomNavBar.getVisibility() == View.VISIBLE) { hide(bottomNavBar); - } else if (dyConsumed < 0 && bottomNavBar.getVisibility() != View.VISIBLE) { + } else if ((dyConsumed < 0 || (!target.canScrollVertically(1) && dyConsumed == 0 + && dyUnconsumed > 40)) && bottomNavBar.getVisibility() != View.VISIBLE) { show(bottomNavBar); } } /** * Animates the hiding of a bottom navigation bar. + * * @param bottomNavBar bottom navigation bar View */ private void hide(final View bottomNavBar) { @@ -73,6 +77,7 @@ public class ScrollAwareLinearBehavior extends CoordinatorLayout.Behavior /** * Animates the showing of a bottom navigation bar. + * * @param bottomNavBar bottom navigation bar View */ private void show(final View bottomNavBar) { @@ -83,7 +88,7 @@ public class ScrollAwareLinearBehavior extends CoordinatorLayout.Behavior animator.setListener(new Animator.AnimatorListener() { @Override - public void onAnimationStart(Animator animator){ + public void onAnimationStart(Animator animator) { bottomNavBar.setVisibility(View.VISIBLE); } diff --git a/app/src/main/res/layout-v21/activity_profile.xml b/app/src/main/res/layout-v21/activity_profile.xml index 9c057147..44f5917b 100644 --- a/app/src/main/res/layout-v21/activity_profile.xml +++ b/app/src/main/res/layout-v21/activity_profile.xml @@ -98,7 +98,7 @@ android:id="@+id/progressBar" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/progress_bar_height" android:indeterminate="true" android:visibility="invisible" app:layout_anchor="@id/profile_tab_container" diff --git a/app/src/main/res/layout/activity_board.xml b/app/src/main/res/layout/activity_board.xml index 4d7a758a..4c0684f7 100644 --- a/app/src/main/res/layout/activity_board.xml +++ b/app/src/main/res/layout/activity_board.xml @@ -40,7 +40,7 @@ android:id="@+id/progressBar" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/progress_bar_height" android:indeterminate="true" android:visibility="invisible" app:layout_anchor="@id/appbar" diff --git a/app/src/main/res/layout/activity_profile.xml b/app/src/main/res/layout/activity_profile.xml index ea3999e3..be02134e 100644 --- a/app/src/main/res/layout/activity_profile.xml +++ b/app/src/main/res/layout/activity_profile.xml @@ -97,7 +97,7 @@ android:id="@+id/progressBar" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/progress_bar_height" android:indeterminate="true" android:visibility="invisible" app:layout_anchor="@id/profile_tab_container" diff --git a/app/src/main/res/layout/activity_topic.xml b/app/src/main/res/layout/activity_topic.xml index b3b2eaca..8d2993ef 100644 --- a/app/src/main/res/layout/activity_topic.xml +++ b/app/src/main/res/layout/activity_topic.xml @@ -94,7 +94,7 @@ android:id="@+id/progressBar" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/progress_bar_height" android:indeterminate="true" android:visibility="invisible" app:layout_anchor="@id/appbar" diff --git a/app/src/main/res/layout/fragment_forum.xml b/app/src/main/res/layout/fragment_forum.xml index ece36fc7..49bf6061 100644 --- a/app/src/main/res/layout/fragment_forum.xml +++ b/app/src/main/res/layout/fragment_forum.xml @@ -16,17 +16,17 @@ android:paddingBottom="4dp" android:paddingTop="4dp" app:layoutManager="LinearLayoutManager" - tools:context=".activities.main.forum.ForumFragment" /> + tools:context=".activities.main.forum.ForumFragment"/> + android:visibility="invisible" + app:mpb_indeterminateTint="@color/accent" + app:mpb_progressStyle="horizontal"/> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_latest_posts.xml b/app/src/main/res/layout/fragment_latest_posts.xml index 9a7cc589..700e57ac 100644 --- a/app/src/main/res/layout/fragment_latest_posts.xml +++ b/app/src/main/res/layout/fragment_latest_posts.xml @@ -17,7 +17,7 @@ android:id="@+id/progressBar" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/progress_bar_height" android:layout_alignParentTop="true" android:indeterminate="true" android:visibility="invisible" diff --git a/app/src/main/res/layout/fragment_recent.xml b/app/src/main/res/layout/fragment_recent.xml index 47de9586..a71079ab 100644 --- a/app/src/main/res/layout/fragment_recent.xml +++ b/app/src/main/res/layout/fragment_recent.xml @@ -26,13 +26,13 @@ + android:visibility="invisible" + app:mpb_indeterminateTint="@color/accent" + app:mpb_progressStyle="horizontal"/> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_stats.xml b/app/src/main/res/layout/fragment_stats.xml index 31013e8a..e19d83dd 100644 --- a/app/src/main/res/layout/fragment_stats.xml +++ b/app/src/main/res/layout/fragment_stats.xml @@ -91,7 +91,7 @@ android:id="@+id/progressBar" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/progress_bar_height" android:layout_alignParentTop="true" android:indeterminate="true" android:visibility="invisible" diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml index c9000c24..d70052bd 100644 --- a/app/src/main/res/values-w820dp/dimens.xml +++ b/app/src/main/res/values-w820dp/dimens.xml @@ -8,4 +8,5 @@ 176dp 144dp 64dp + 40dp diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index ba93f78a..a779507a 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -6,4 +6,5 @@ 44dp 36dp 16dp + 10dp