Show default thumbnail

This commit is contained in:
RichyHBM 2017-11-25 13:30:49 +00:00
parent d07db0b07f
commit 1b1c00d603
7 changed files with 26 additions and 1 deletions

View file

@ -429,7 +429,8 @@ public class MainActivity extends BaseActivity
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if (key.equals(getString(R.string.settings_key_label_size)) || if (key.equals(getString(R.string.settings_key_label_size)) ||
key.equals(getString(R.string.settings_key_tap_to_reveal)) || key.equals(getString(R.string.settings_key_tap_to_reveal)) ||
key.equals(getString(R.string.settings_key_label_scroll))) { key.equals(getString(R.string.settings_key_label_scroll)) ||
key.equals(getString(R.string.settings_key_thumbnail_visible))) {
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
} else if (key.equals(getString(R.string.settings_key_theme)) || } else if (key.equals(getString(R.string.settings_key_theme)) ||
key.equals(getString(R.string.settings_key_lang))) { key.equals(getString(R.string.settings_key_lang))) {

View file

@ -330,4 +330,9 @@ public class Settings {
toggledTags.add(tag); toggledTags.add(tag);
setStringSet(R.string.settings_key_tags_toggles, toggledTags); setStringSet(R.string.settings_key_tags_toggles, toggledTags);
} }
public boolean getThumbnailVisible() {
return getBoolean(R.string.settings_key_thumbnail_visible, true);
}
} }

View file

@ -13,6 +13,13 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:baselineAligned="false" > android:baselineAligned="false" >
<ImageView
android:id="@+id/thumbnailImg"
android:layout_width="@dimen/card_thumbnail_size"
android:layout_height="@dimen/card_thumbnail_size"
android:layout_marginEnd="@dimen/activity_margin_small"
android:src="@mipmap/ic_launcher"/>
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="0dip" android:layout_width="0dip"

View file

@ -9,6 +9,10 @@
<dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="card_corner_radius">0dp</dimen> <dimen name="card_corner_radius">0dp</dimen>
<dimen name="card_thumbnail_size">64dp</dimen>
<!-- The default letter tile text size -->
<dimen name="tile_letter_font_size">33sp</dimen>
<dimen name="drawer_width">200dp</dimen> <dimen name="drawer_width">200dp</dimen>
<dimen name="divider_size">1dp</dimen> <dimen name="divider_size">1dp</dimen>

View file

@ -15,6 +15,7 @@
<string name="settings_key_theme" translatable="false">pref_theme</string> <string name="settings_key_theme" translatable="false">pref_theme</string>
<string name="settings_key_label_size" translatable="false">pref_label_size</string> <string name="settings_key_label_size" translatable="false">pref_label_size</string>
<string name="settings_key_label_scroll" translatable="false">pref_label_scroll</string> <string name="settings_key_label_scroll" translatable="false">pref_label_scroll</string>
<string name="settings_key_thumbnail_visible" translatable="false">pref_thumbnail_visible</string>
<string name="settings_key_backup_ask" translatable="false">pref_backup_ask</string> <string name="settings_key_backup_ask" translatable="false">pref_backup_ask</string>
<string name="settings_key_backup_directory" translatable="false">pref_backup_directory</string> <string name="settings_key_backup_directory" translatable="false">pref_backup_directory</string>

View file

@ -18,6 +18,7 @@
<string name="settings_title_theme">Theme</string> <string name="settings_title_theme">Theme</string>
<string name="settings_title_label_size">Label font size</string> <string name="settings_title_label_size">Label font size</string>
<string name="settings_title_label_scroll">Scroll label</string> <string name="settings_title_label_scroll">Scroll label</string>
<string name="settings_title_thumbnail_visible_ask">Show thumbnails</string>
<string name="settings_title_backup_ask">Ask for filename</string> <string name="settings_title_backup_ask">Ask for filename</string>
<string name="settings_title_backup_directory">Backup directory</string> <string name="settings_title_backup_directory">Backup directory</string>

View file

@ -66,6 +66,12 @@
android:summary="@string/settings_desc_label_scroll" android:summary="@string/settings_desc_label_scroll"
android:defaultValue="false" /> android:defaultValue="false" />
<CheckBoxPreference
android:key="@string/settings_key_thumbnail_visible"
android:title="@string/settings_title_thumbnail_visible_ask"
android:defaultValue="true" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory