Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Fixes #48
Browse files Browse the repository at this point in the history
  • Loading branch information
Garret Yoder committed Sep 21, 2016
1 parent d166db3 commit cdc8729
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ public class ScreenshotDialog extends Dialog implements View.OnClickListener {
private final int currentImage;
@BindView(R.id.screenshot_dialog_pager) ViewPager viewPager;
@BindView(R.id.screenshot_dialog_toolbar) Toolbar toolbar;
@BindView(R.id.screenshot_dialog_page_indicator) TextView pageIndicator;

public ScreenshotDialog(Context context, List<String> urls, int currentImage) {
super(context, android.R.style.Theme_Black_NoTitleBar);
super(context, R.style.AppTheme_Black);
this.currentImage = currentImage;
this.urls = urls;
}
Expand All @@ -34,6 +33,7 @@ protected void onCreate(Bundle savedInstanceState) {
ButterKnife.bind(this);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_48px);
toolbar.setNavigationOnClickListener(this);
toolbar.setTitle(R.string.screenshots);

ScreenshotsAdapter screenshotsAdapter = new ScreenshotsAdapter(getContext(), 1);
screenshotsAdapter.update(urls);
Expand All @@ -59,7 +59,7 @@ public void onPageScrollStateChanged(int state) {
}

private void updatePageIndicator(int position) {
pageIndicator.setText(String.format("%s/%s", position + 1, urls.size()));
toolbar.setSubtitle(String.format("%s/%s", position + 1, urls.size()));
}

@Override
Expand Down
16 changes: 2 additions & 14 deletions app/src/main/res/layout/dialog_screenshot.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Expand All @@ -9,19 +8,8 @@
android:id="@+id/screenshot_dialog_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary">

<TextView
android:id="@+id/screenshot_dialog_page_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:textColor="@android:color/white"
tools:text="1/4" />

</android.support.v7.widget.Toolbar>
android:background="@color/colorPrimary"
android:title="@string/screenshots"/>

<android.support.v4.view.ViewPager
android:id="@+id/screenshot_dialog_pager"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
<string name="appearance">Appearance</string>
<string name="preference_theme">Theme</string>
<string name="preference_theme_desc">Theme to use</string>
<string name="restart">A restart is required to toggle night mode</string>
<string name="restart">A restart is required to toggle themes</string>
<string name="later">Later</string>
<string name="app_category_everything">Everything</string>
<string name="error">Error fetching repository</string>
<string name="data_options">Data options</string>
<string name="screenshots">Screenshots</string>
<string name="data_option_loadmedia_title"><![CDATA[Icons & screenshots]]></string>
<string name="data_option_loadmedia_summary">Load app icons and screenshots</string>
<string name="update">Update available</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
</style>

<style name="AppTheme.Black" parent="AppTheme.Dark">
<item name="android:colorBackground">#FF000000</item>
<item name="android:windowBackground">@android:color/black</item>
<item name="android:colorBackground">@android:color/black</item>
</style>

<style name="DefaultListItemContainer">
Expand Down

0 comments on commit cdc8729

Please sign in to comment.