Skip to content

Commit

Permalink
#452 - Few issues in Bottom sheet (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
konstzv authored and Swati4star committed Oct 4, 2018
1 parent 5e42626 commit a860e28
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@

import java.util.ArrayList;

import swati4star.createpdf.R;
import swati4star.createpdf.adapter.MergeFilesAdapter;
import swati4star.createpdf.interfaces.BottomSheetPopulate;

public class BottomSheetUtils implements BottomSheetPopulate {

private Activity mContext;


public BottomSheetUtils(Activity context) {
this.mContext = context;
}
Expand All @@ -28,6 +30,7 @@ public void showHideSheet(BottomSheetBehavior sheetBehavior) {
}
}

private View mFetchingFilesLabel;
RelativeLayout bottomSheetLayout;
RecyclerView recyclerView;
MergeFilesAdapter.OnClickListener listener;
Expand All @@ -38,6 +41,8 @@ public void populateBottomSheetWithPDFs(RelativeLayout bottomSheetLayout,
this.bottomSheetLayout = bottomSheetLayout;
this.recyclerView = recyclerView;
this.listener = listener;
mFetchingFilesLabel = bottomSheetLayout.getRootView().findViewById(R.id.fetching);

new PopulateBottomSheetList(this, new DirectoryUtils(mContext)).execute();

}
Expand All @@ -56,6 +61,6 @@ public void onPopulate(ArrayList<String> paths) {
recyclerView.setAdapter(mergeFilesAdapter);
recyclerView.addItemDecoration(new ViewFilesDividerItemDecoration(mContext));
}

mFetchingFilesLabel.setVisibility(View.GONE);
}
}
21 changes: 18 additions & 3 deletions app/src/main/res/layout/bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,24 @@
app:srcCompat="@drawable/ic_arrow_up_black_24dp" />
</RelativeLayout>

<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerViewFiles"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content">

<TextView
android:id="@+id/fetching"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="12dp"
android:text="@string/fetching_files"
android:textSize="16sp"
android:textStyle="bold" />


<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerViewFiles"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>

</LinearLayout>
5 changes: 3 additions & 2 deletions app/src/main/res/layout/item_merge_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
android:layout_centerVertical="true"
android:layout_marginEnd="20dp"
android:contentDescription="@string/encrypted_file_text"
app:srcCompat="@drawable/ic_lock_black_24dp"
android:visibility="gone" />
android:tint="?attr/lockIconTintColor"
android:visibility="gone"
app:srcCompat="@drawable/ic_lock_black_24dp" />

</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,6 @@
<string name="theme_black">Black</string>
<string name="remove_page_message">Are you sure you want to remove this page?</string>
<string name="file_access_error">We were unable to access PDF. Files may be encrypted or in the external storage.</string>
<string name="fetching_files">fetching files…</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,5 +310,6 @@
<string name="theme_black">Black</string>
<string name="remove_page_message">Are you sure you want to remove this page?</string>
<string name="file_access_error">We were unable to access PDF. Files may be encrypted or in the external storage.</string>
<string name="fetching_files">fetching files…</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,6 @@
<string name="theme_black">Black</string>
<string name="remove_page_message">Are you sure you want to remove this page?</string>
<string name="file_access_error">We were unable to access PDF. Files may be encrypted or in the external storage.</string>
<string name="fetching_files">fetching files…</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
<attr name="bannerBackgroundColor" format="color"/>
<attr name="similarBgColor" format="color"/>
<attr name="bottomSheetBgColor" format="color"/>
<attr name="lockIconTintColor" format="color"/>
</declare-styleable>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,6 @@
<string name="viewfiles_addpassword">1. Select the PDF you wish to add password to. \n2. Select Add Password. \n3. Type new password. Select OK. \n4. New PDF with password be created.</string>
<string name="viewfiles_removepassword">1. Select the PDF you wish to remove password from. \n2. Select Remove Password. \n3. Type pdf password. Select OK. \n4. New PDF without PDF will be created.</string>
<string name="grayscale_images">Create grayscale PDF</string>
<string name="fetching_files">fetching files…</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<item name="bannerBackgroundColor">@color/colorAccent</item>
<item name="similarBgColor">@color/mb_white</item>
<item name="bottomSheetBgColor">@color/windowBackground_light</item>
<item name="lockIconTintColor">@color/black</item>
</style>

<style name="AppThemeBlack" parent="Theme.AppCompat.NoActionBar">
Expand All @@ -32,6 +33,7 @@
<item name="bannerBackgroundColor">@color/windowBackground_dark</item>
<item name="similarBgColor">@color/black</item>
<item name="bottomSheetBgColor">@color/colorBackground_black</item>
<item name="lockIconTintColor">@color/mb_white</item>
</style>

<style name="ActivityThemeDark" parent="Theme.AppCompat.NoActionBar">
Expand All @@ -47,6 +49,7 @@
<item name="bannerBackgroundColor">@color/colorAccent</item>
<item name="similarBgColor">@color/black</item>
<item name="bottomSheetBgColor">@color/windowBackground_dark</item>
<item name="lockIconTintColor">@color/mb_white</item>
</style>

<style name="ToolbarTheme">
Expand Down

0 comments on commit a860e28

Please sign in to comment.