Merge branch 'material' into dev

Conflicts:
	Clover/app/src/main/res/menu/base.xml
tempwork
Floens 11 years ago
commit 3d70e4edec
  1. 2
      .gitignore
  2. 5
      Clover/app/build.gradle
  3. 44
      Clover/app/src/main/AndroidManifest.xml
  4. 2
      Clover/app/src/main/java/org/floens/chan/chan/ImageSearch.java
  5. 4
      Clover/app/src/main/java/org/floens/chan/core/ChanPreferences.java
  6. 2
      Clover/app/src/main/java/org/floens/chan/core/model/PostLinkable.java
  7. 48
      Clover/app/src/main/java/org/floens/chan/ui/ThemeActivity.java
  8. 11
      Clover/app/src/main/java/org/floens/chan/ui/activity/AboutActivity.java
  9. 14
      Clover/app/src/main/java/org/floens/chan/ui/activity/AdvancedSettingsActivity.java
  10. 50
      Clover/app/src/main/java/org/floens/chan/ui/activity/BaseActivity.java
  11. 15
      Clover/app/src/main/java/org/floens/chan/ui/activity/BoardEditor.java
  12. 55
      Clover/app/src/main/java/org/floens/chan/ui/activity/ChanActivity.java
  13. 11
      Clover/app/src/main/java/org/floens/chan/ui/activity/DeveloperActivity.java
  14. 51
      Clover/app/src/main/java/org/floens/chan/ui/activity/ImageViewActivity.java
  15. 64
      Clover/app/src/main/java/org/floens/chan/ui/activity/PassSettingsActivity.java
  16. 26
      Clover/app/src/main/java/org/floens/chan/ui/activity/ReplyActivity.java
  17. 16
      Clover/app/src/main/java/org/floens/chan/ui/activity/SettingsActivity.java
  18. 70
      Clover/app/src/main/java/org/floens/chan/ui/activity/WatchSettingsActivity.java
  19. 18
      Clover/app/src/main/java/org/floens/chan/ui/fragment/ImageViewFragment.java
  20. 8
      Clover/app/src/main/java/org/floens/chan/ui/fragment/ReplyFragment.java
  21. 8
      Clover/app/src/main/java/org/floens/chan/ui/fragment/ThreadFragment.java
  22. 2
      Clover/app/src/main/java/org/floens/chan/ui/view/ThumbnailImageView.java
  23. 5
      Clover/app/src/main/res/anim/fade_in.xml
  24. 5
      Clover/app/src/main/res/anim/fade_out.xml
  25. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_action_chat.png
  26. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_action_make_available_offline.png
  27. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_action_refresh.png
  28. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_action_write.png
  29. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_bookmark.png
  30. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_bookmark_filled.png
  31. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_action_chat.png
  32. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_action_make_available_offline.png
  33. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_action_refresh.png
  34. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_action_write.png
  35. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_bookmark.png
  36. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_bookmark_filled.png
  37. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_action_chat.png
  38. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_action_make_available_offline.png
  39. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_action_refresh.png
  40. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_action_write.png
  41. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_bookmark.png
  42. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_bookmark_filled.png
  43. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_action_chat.png
  44. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_action_make_available_offline.png
  45. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png
  46. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_action_write.png
  47. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_bookmark.png
  48. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_bookmark_filled.png
  49. BIN
      Clover/app/src/main/res/drawable-xxxhdpi/ic_action_refresh.png
  50. BIN
      Clover/app/src/main/res/drawable-xxxhdpi/ic_action_write.png
  51. BIN
      Clover/app/src/main/res/drawable-xxxhdpi/ic_bookmark.png
  52. BIN
      Clover/app/src/main/res/drawable-xxxhdpi/ic_bookmark_filled.png
  53. 12
      Clover/app/src/main/res/drawable/pin_icon_blue.xml
  54. 12
      Clover/app/src/main/res/drawable/pin_icon_gray.xml
  55. 12
      Clover/app/src/main/res/drawable/pin_icon_red.xml
  56. 23
      Clover/app/src/main/res/layout/activity_base.xml
  57. 10
      Clover/app/src/main/res/layout/board_edit_item.xml
  58. 10
      Clover/app/src/main/res/layout/board_select_add.xml
  59. 10
      Clover/app/src/main/res/layout/board_select_spinner.xml
  60. 29
      Clover/app/src/main/res/layout/board_select_spinner_dropdown.xml
  61. 2
      Clover/app/src/main/res/layout/folder_pick.xml
  62. 63
      Clover/app/src/main/res/layout/header_switch_layout.xml
  63. 48
      Clover/app/src/main/res/layout/image_view.xml
  64. 17
      Clover/app/src/main/res/layout/preference_pass.xml
  65. 26
      Clover/app/src/main/res/layout/toolbar.xml
  66. 23
      Clover/app/src/main/res/layout/toolbar_activity.xml
  67. 32
      Clover/app/src/main/res/layout/watch_description.xml
  68. 9
      Clover/app/src/main/res/menu/action_bar_switch.xml
  69. 33
      Clover/app/src/main/res/menu/base.xml
  70. 14
      Clover/app/src/main/res/menu/board_edit.xml
  71. 15
      Clover/app/src/main/res/menu/image_view.xml
  72. 10
      Clover/app/src/main/res/menu/settings.xml
  73. 96
      Clover/app/src/main/res/values/attrs.xml
  74. 8
      Clover/app/src/main/res/values/colors.xml
  75. 9
      Clover/app/src/main/res/values/dimens.xml
  76. 6
      Clover/app/src/main/res/values/strings.xml
  77. 34
      Clover/app/src/main/res/values/styles.xml
  78. 5
      Clover/app/src/main/res/xml/preference_advanced.xml
  79. 9
      Clover/app/src/main/res/xml/preference_pass.xml

2
.gitignore vendored

@ -43,7 +43,7 @@ local.properties
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
.gradle
build/
#*.iml
*.iml
## Windows detritus
#############

@ -67,10 +67,13 @@ android {
}
dependencies {
compile 'com.android.support:support-v13:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v13:18.0.0'
compile 'org.jsoup:jsoup:1.8.1'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.android.support:support-v13:18.0.0'
compile 'com.koushikdutta.ion:ion:2.0.1'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.0'

@ -80,60 +80,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:windowSoftInputMode="adjustResize" />
<activity
android:name="org.floens.chan.ui.activity.SettingsActivity"
android:label="@string/action_settings"
android:parentActivityName=".ui.activity.ChanActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.floens.chan.ui.activity.BoardActivity" />
</activity>
android:label="@string/action_settings" />
<activity
android:name="org.floens.chan.ui.activity.WatchSettingsActivity"
android:label="@string/preference_watch_settings"
android:parentActivityName=".ui.activity.ChanActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.floens.chan.ui.activity.BoardActivity" />
</activity>
android:label="@string/preference_watch_settings" />
<activity
android:name="org.floens.chan.ui.activity.PassSettingsActivity"
android:label="@string/preference_pass_settings"
android:parentActivityName=".ui.activity.ChanActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.floens.chan.ui.activity.BoardActivity" />
</activity>
android:label="@string/preference_pass_settings" />
<activity
android:name="org.floens.chan.ui.activity.AboutActivity"
android:label="@string/preference_about"
android:parentActivityName=".ui.activity.ChanActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.floens.chan.ui.activity.BoardActivity" />
</activity>
android:label="@string/preference_about" />
<activity
android:name="org.floens.chan.ui.activity.BoardEditor"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/board_edit"
android:parentActivityName=".ui.activity.ChanActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.floens.chan.ui.activity.BoardActivity" />
</activity>
android:label="@string/board_edit" />
<activity
android:name="org.floens.chan.ui.activity.ImageViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:theme="@style/Theme.ImageList" />
android:theme="@style/Chan.ImageView" />
<activity android:name="org.floens.chan.ui.activity.ImagePickActivity" />
<activity android:name="org.floens.chan.ui.activity.DeveloperActivity" />
<activity
android:name="org.floens.chan.ui.activity.AdvancedSettingsActivity"
android:label="@string/settings_advanced_label"
android:parentActivityName=".ui.activity.ChanActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.floens.chan.ui.activity.BoardActivity" />
</activity>
android:label="@string/settings_advanced_label" />
<service
android:name=".ui.service.WatchNotifier"

@ -26,7 +26,9 @@ public abstract class ImageSearch {
public static final List<ImageSearch> engines = new ArrayList<>();
public abstract int getId();
public abstract String getName();
public abstract String getUrl(String imageUrl);
static {

@ -69,6 +69,10 @@ public class ChanPreferences {
return p().getBoolean("preference_image_save_original", false);
}
public static boolean getImageShareUrl() {
return p().getBoolean("preference_image_share_url", false);
}
public static boolean getWatchEnabled() {
return p().getBoolean("preference_watch_enabled", false);
}

@ -57,7 +57,7 @@ public class PostLinkable extends ClickableSpan {
public void updateDrawState(TextPaint ds) {
if (type == Type.QUOTE || type == Type.LINK || type == Type.THREAD) {
if (type == Type.QUOTE) {
if (value instanceof Integer && post.getLinkableListener() != null && (Integer)value == post.getLinkableListener().getHighlightQuotesWithNo()) {
if (value instanceof Integer && post.getLinkableListener() != null && (Integer) value == post.getLinkableListener().getHighlightQuotesWithNo()) {
ds.setColor(ThemeHelper.getInstance().getHighlightQuoteColor());
} else {
ds.setColor(ThemeHelper.getInstance().getQuoteColor());

@ -0,0 +1,48 @@
/*
* Clover - 4chan browser https://github.com/Floens/Clover/
* Copyright (C) 2014 Floens
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.floens.chan.ui;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import org.floens.chan.R;
import org.floens.chan.utils.ThemeHelper;
public class ThemeActivity extends ActionBarActivity {
private Toolbar toolbar;
public void setTheme() {
setTheme(ThemeHelper.getInstance().getTheme().resValue);
}
public void setToolbar() {
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
return true;
} else {
return super.onOptionsItemSelected(item);
}
}
}

@ -17,18 +17,21 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import org.floens.chan.utils.ThemeHelper;
import org.floens.chan.R;
import org.floens.chan.ui.ThemeActivity;
public class AboutActivity extends Activity {
public class AboutActivity extends ThemeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
setTheme();
setContentView(R.layout.toolbar_activity);
setToolbar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
WebView webView = new WebView(this);
webView.loadUrl("file:///android_asset/html/licenses.html");

@ -17,7 +17,6 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
@ -26,19 +25,22 @@ import android.preference.PreferenceFragment;
import org.floens.chan.R;
import org.floens.chan.chan.ChanUrls;
import org.floens.chan.core.ChanPreferences;
import org.floens.chan.ui.ThemeActivity;
import org.floens.chan.ui.fragment.FolderPickFragment;
import org.floens.chan.utils.ThemeHelper;
import java.io.File;
public class AdvancedSettingsActivity extends Activity {
public class AdvancedSettingsActivity extends ThemeActivity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
setTheme();
setContentView(R.layout.toolbar_activity);
setToolbar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getFragmentManager().beginTransaction().replace(android.R.id.content, new AdvancedSettingsFragment()).commit();
getFragmentManager().beginTransaction().replace(R.id.content, new AdvancedSettingsFragment()).commit();
}
public static class AdvancedSettingsFragment extends PreferenceFragment {
@ -112,7 +114,7 @@ public class AdvancedSettingsActivity extends Activity {
findPreference("preference_network_https").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
ChanUrls.loadScheme((Boolean)newValue);
ChanUrls.loadScheme((Boolean) newValue);
return true;
}

@ -17,22 +17,21 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SlidingPaneLayout;
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.ShareActionProvider;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
@ -43,7 +42,6 @@ import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.ShareActionProvider;
import org.floens.chan.ChanApplication;
import org.floens.chan.R;
@ -52,16 +50,14 @@ import org.floens.chan.core.model.ChanThread;
import org.floens.chan.core.model.Loadable;
import org.floens.chan.core.model.Pin;
import org.floens.chan.core.model.Post;
import org.floens.chan.ui.BadgeDrawable;
import org.floens.chan.ui.SwipeDismissListViewTouchListener;
import org.floens.chan.ui.SwipeDismissListViewTouchListener.DismissCallbacks;
import org.floens.chan.ui.ThemeActivity;
import org.floens.chan.ui.adapter.PinnedAdapter;
import org.floens.chan.utils.ThemeHelper;
import org.floens.chan.utils.Utils;
import java.util.List;
public abstract class BaseActivity extends Activity implements PanelSlideListener, WatchManager.PinListener {
public abstract class BaseActivity extends ThemeActivity implements PanelSlideListener, WatchManager.PinListener {
public static boolean doRestartOnResume = false;
private final static int ACTION_OPEN_URL = 1;
@ -99,11 +95,13 @@ public abstract class BaseActivity extends Activity implements PanelSlideListene
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
ThemeHelper.getInstance().reloadPostViewColors(this);
setContentView(R.layout.activity_base);
setTheme();
setToolbar();
pinDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
initDrawer();
@ -115,6 +113,15 @@ public abstract class BaseActivity extends Activity implements PanelSlideListene
updateIcon();
}
@Override
public void onBackPressed() {
if (pinDrawer.isDrawerOpen(pinDrawerView)) {
pinDrawer.closeDrawer(pinDrawerView);
} else {
super.onBackPressed();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
@ -155,7 +162,7 @@ public abstract class BaseActivity extends Activity implements PanelSlideListene
pinDrawerView = (ListView) findViewById(R.id.left_drawer);
pinnedAdapter = new PinnedAdapter(getActionBar().getThemedContext(), pinDrawerView); // Get the dark theme, not the light one
pinnedAdapter = new PinnedAdapter(getSupportActionBar().getThemedContext(), pinDrawerView); // Get the dark theme, not the light one
pinnedAdapter.reload();
pinDrawerView.setAdapter(pinnedAdapter);
@ -210,7 +217,7 @@ public abstract class BaseActivity extends Activity implements PanelSlideListene
}
private void updateIcon() {
List<Pin> list = ChanApplication.getWatchManager().getWatchingPins();
/*List<Pin> list = ChanApplication.getWatchManager().getWatchingPins();
if (list.size() > 0) {
int count = 0;
boolean color = false;
@ -223,13 +230,13 @@ public abstract class BaseActivity extends Activity implements PanelSlideListene
if (count > 0) {
Drawable icon = BadgeDrawable.get(getResources(), R.drawable.ic_launcher, count, color);
getActionBar().setIcon(icon);
getSupportActionBar().setIcon(icon);
} else {
getActionBar().setIcon(R.drawable.ic_launcher);
getSupportActionBar().setIcon(R.drawable.ic_launcher);
}
} else {
getActionBar().setIcon(R.drawable.ic_launcher);
}
getSupportActionBar().setIcon(R.drawable.ic_launcher);
}*/
}
public void removePin(Pin pin) {
@ -295,11 +302,11 @@ public abstract class BaseActivity extends Activity implements PanelSlideListene
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.base, menu);
shareActionProvider = (ShareActionProvider) menu.findItem(R.id.action_share).getActionProvider();
/*shareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(menu.findItem(R.id.action_share));
if (pendingShareActionProviderIntent != null) {
shareActionProvider.setShareIntent(pendingShareActionProviderIntent);
pendingShareActionProviderIntent = null;
}
}*/
return true;
}
@ -366,12 +373,9 @@ public abstract class BaseActivity extends Activity implements PanelSlideListene
* @param url
*/
public void showUrlOpenPicker(String url) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
pickIntent.putExtra(Intent.EXTRA_INTENT, intent);
startActivityForResult(pickIntent, ACTION_OPEN_URL);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
}
/**

@ -17,7 +17,6 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
@ -52,14 +51,14 @@ import org.floens.chan.core.ChanPreferences;
import org.floens.chan.core.manager.BoardManager;
import org.floens.chan.core.model.Board;
import org.floens.chan.ui.SwipeDismissListViewTouchListener;
import org.floens.chan.utils.ThemeHelper;
import org.floens.chan.ui.ThemeActivity;
import org.floens.chan.utils.Utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class BoardEditor extends Activity {
public class BoardEditor extends ThemeActivity {
private final BoardManager boardManager = ChanApplication.getBoardManager();
private List<Board> list;
@ -70,7 +69,10 @@ public class BoardEditor extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
setTheme();
setContentView(R.layout.toolbar_activity);
setToolbar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
list = boardManager.getSavedBoards();
@ -150,7 +152,7 @@ public class BoardEditor extends Activity {
}
});
setContentView(listView);
((ViewGroup) findViewById(R.id.content)).addView(listView);
}
@Override
@ -186,6 +188,9 @@ public class BoardEditor extends Activity {
ChanPreferences.setBoardEditorFillerEnabled(!ChanPreferences.getBoardEditorFillerEnabled());
item.setChecked(ChanPreferences.getBoardEditorFillerEnabled());
return true;
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);

@ -17,7 +17,6 @@
*/
package org.floens.chan.ui.activity;
import android.app.ActionBar;
import android.app.AlertDialog;
import android.app.FragmentTransaction;
import android.content.Context;
@ -26,7 +25,8 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarDrawerToggle;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.Menu;
@ -89,9 +89,9 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
ft.replace(R.id.right_pane, threadFragment);
ft.commitAllowingStateLoss();
final ActionBar actionBar = getActionBar();
final ActionBar actionBar = getSupportActionBar();
boardSpinner = new Spinner(actionBar.getThemedContext());
boardSpinner = new Spinner(this);
spinnerAdapter = new BoardSpinnerAdapter(this, boardSpinner);
boardSpinner.setAdapter(spinnerAdapter);
boardSpinner.setOnItemSelectedListener(this);
@ -180,9 +180,7 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
@Override
protected void initDrawer() {
pinDrawerListener = new ActionBarDrawerToggle(this, pinDrawer, R.drawable.ic_drawer, R.string.drawer_open,
R.string.drawer_close) {
};
pinDrawerListener = new ActionBarDrawerToggle(this, pinDrawer, R.string.drawer_open, R.string.drawer_close);
super.initDrawer();
}
@ -203,12 +201,16 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
@Override
public void onBackPressed() {
if (pinDrawer.isDrawerOpen(pinDrawerView)) {
pinDrawer.closeDrawer(pinDrawerView);
} else {
if (threadPane.isOpen()) {
super.onBackPressed();
} else {
threadPane.openPane();
}
}
}
@Override
public void openPin(Pin pin) {
@ -241,6 +243,12 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
updateActionBarState();
}
@Override
public void removePin(Pin pin) {
super.removePin(pin);
updateActionBarState();
}
@Override
public void onNothingSelected(final AdapterView<?> parent) {
}
@ -360,7 +368,7 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
}
private void updateActionBarStateCallback() {
final ActionBar actionBar = getActionBar();
final ActionBar actionBar = getSupportActionBar();
if (threadPane.isSlideable()) {
if (threadPane.isOpen()) {
@ -425,6 +433,16 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
setMenuItemEnabled(menu.findItem(R.id.action_search), slidable);
setMenuItemEnabled(menu.findItem(R.id.action_search_tablet), !slidable);
boolean bookmarkedFilled = false;
if (threadLoadable.mode == Loadable.Mode.THREAD) {
Pin pin = ChanApplication.getWatchManager().findPinByLoadable(threadLoadable);
if (pin != null) {
bookmarkedFilled = true;
}
}
menu.findItem(R.id.action_pin).setIcon(bookmarkedFilled ? R.drawable.ic_bookmark_filled : R.drawable.ic_bookmark);
return super.onPrepareOptionsMenu(menu);
}
@ -469,8 +487,13 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
if (threadFragment.hasLoader()) {
Loader loader = threadFragment.getLoader();
if (loader != null && loader.getLoadable().isThreadMode() && loader.getThread() != null) {
Pin pin = ChanApplication.getWatchManager().findPinByLoadable(threadLoadable);
if (pin != null) {
ChanApplication.getWatchManager().removePin(pin);
} else {
ChanApplication.getWatchManager().addPin(loader.getLoadable(), loader.getThread().op);
pinDrawer.openDrawer(pinDrawerView);
}
updateActionBarState();
}
}
@ -712,14 +735,24 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
}
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
return createView(position, convertView, parent, true);
}
@Override
public View getView(final int position, View convertView, final ViewGroup parent) {
return createView(position, convertView, parent, false);
}
private View createView(int position, View convertView, ViewGroup parent, boolean dropDown) {
if (position == getCount() - 1) {
TextView textView = (TextView) LayoutInflater.from(context).inflate(R.layout.board_select_add, null);
TextView textView = (TextView) LayoutInflater.from(context).inflate(R.layout.board_select_add, parent, false);
textView.setText(getItem(position));
return textView;
} else {
TextView textView = (TextView) LayoutInflater.from(context).inflate(R.layout.board_select_spinner, null);
TextView textView = (TextView) LayoutInflater.from(context).inflate(
dropDown ? R.layout.board_select_spinner_dropdown : R.layout.board_select_spinner, parent, false);
textView.setText(getItem(position));
return textView;
}

@ -17,7 +17,6 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@ -25,17 +24,21 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import org.floens.chan.ChanApplication;
import org.floens.chan.R;
import org.floens.chan.core.model.SavedReply;
import org.floens.chan.utils.ThemeHelper;
import org.floens.chan.ui.ThemeActivity;
import java.util.Random;
public class DeveloperActivity extends Activity {
public class DeveloperActivity extends ThemeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
setTheme();
setContentView(R.layout.toolbar_activity);
setToolbar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
LinearLayout wrapper = new LinearLayout(this);
wrapper.setOrientation(LinearLayout.VERTICAL);

@ -17,7 +17,6 @@
*/
package org.floens.chan.ui.activity;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
@ -26,8 +25,6 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.ProgressBar;
import org.floens.chan.R;
@ -35,12 +32,12 @@ import org.floens.chan.chan.ImageSearch;
import org.floens.chan.core.ChanPreferences;
import org.floens.chan.core.manager.ThreadManager;
import org.floens.chan.core.model.Post;
import org.floens.chan.ui.ThemeActivity;
import org.floens.chan.ui.adapter.ImageViewAdapter;
import org.floens.chan.ui.adapter.PostAdapter;
import org.floens.chan.ui.fragment.ImageViewFragment;
import org.floens.chan.utils.ImageSaver;
import org.floens.chan.utils.Logger;
import org.floens.chan.utils.ThemeHelper;
import java.util.ArrayList;
import java.util.List;
@ -49,15 +46,16 @@ import java.util.List;
* An fragment pager that contains images. Call setPosts first, and then start
* the activity with startActivity()
*/
public class ImageViewActivity extends Activity implements ViewPager.OnPageChangeListener {
public class ImageViewActivity extends ThemeActivity implements ViewPager.OnPageChangeListener {
private static final String TAG = "ImageViewActivity";
private static PostAdapter postAdapterStatic;
private static int selectedIdStatic = -1;
private static int selectedNoStatic = -1;
private static ThreadManager threadManagerStatic;
private PostAdapter postAdapter;
private ThreadManager threadManager;
private int selectedNo;
private ImageViewAdapter adapter;
private ViewPager viewPager;
@ -72,7 +70,7 @@ public class ImageViewActivity extends Activity implements ViewPager.OnPageChang
*/
public static void launch(Activity activity, PostAdapter adapter, int selected, ThreadManager threadManager) {
postAdapterStatic = adapter;
selectedIdStatic = selected;
selectedNoStatic = selected;
threadManagerStatic = threadManager;
Intent intent = new Intent(activity, ImageViewActivity.class);
@ -82,44 +80,36 @@ public class ImageViewActivity extends Activity implements ViewPager.OnPageChang
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
ActionBar actionBar = getActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_HOME_AS_UP);
super.onCreate(savedInstanceState);
if (postAdapterStatic == null || threadManagerStatic == null) {
Logger.e(TAG, "postadapter or threadmanager null");
finish();
return;
}
super.onCreate(savedInstanceState);
threadManager = threadManagerStatic;
threadManagerStatic = null;
postAdapter = postAdapterStatic;
postAdapterStatic = null;
int selectedId = selectedIdStatic;
selectedIdStatic = -1;
selectedNo = selectedNoStatic;
selectedNoStatic = -1;
ThemeHelper.setTheme(this);
setContentView(R.layout.image_view);
setToolbar();
progressBar = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal);
progressBar.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
progressBar.setProgressDrawable(getResources().getDrawable(R.drawable.progressbar_no_bg));
initProgressBar();
initPager();
}
private void initProgressBar() {
progressBar = (ProgressBar) findViewById(R.id.progress_bar);
// progressBar.setProgressDrawable(getResources().getDrawable(R.drawable.progressbar_no_bg));
progressBar.setIndeterminate(false);
progressBar.setMax(1000000);
final FrameLayout decorView = (FrameLayout) getWindow().getDecorView();
decorView.addView(progressBar);
progressBar.post(new Runnable() {
@Override
public void run() {
View contentView = decorView.findViewById(android.R.id.content);
progressBar.setY(contentView.getY() - progressBar.getHeight() / 2);
}
});
private void initPager() {
// Get the posts with images
ArrayList<Post> imagePosts = new ArrayList<>();
for (Post post : postAdapter.getList()) {
@ -129,7 +119,6 @@ public class ImageViewActivity extends Activity implements ViewPager.OnPageChang
}
// Setup our pages and adapter
setContentView(R.layout.image_pager);
viewPager = (ViewPager) findViewById(R.id.image_pager);
adapter = new ImageViewAdapter(getFragmentManager(), this);
adapter.setList(imagePosts);
@ -138,7 +127,7 @@ public class ImageViewActivity extends Activity implements ViewPager.OnPageChang
// Select the right image
for (int i = 0; i < imagePosts.size(); i++) {
if (imagePosts.get(i).no == selectedId) {
if (imagePosts.get(i).no == selectedNo) {
viewPager.setCurrentItem(i);
onPageSelected(i);
break;

@ -17,7 +17,6 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Fragment;
import android.app.FragmentTransaction;
@ -25,16 +24,15 @@ import android.app.ProgressDialog;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.support.v7.widget.SwitchCompat;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.Switch;
import android.widget.TextView;
import org.floens.chan.ChanApplication;
@ -43,54 +41,47 @@ import org.floens.chan.core.ChanPreferences;
import org.floens.chan.core.manager.ReplyManager;
import org.floens.chan.core.manager.ReplyManager.PassResponse;
import org.floens.chan.core.model.Pass;
import org.floens.chan.utils.ThemeHelper;
import org.floens.chan.ui.ThemeActivity;
import org.floens.chan.utils.Utils;
public class PassSettingsActivity extends Activity implements OnCheckedChangeListener {
private static PassSettingsActivity instance;
private Switch enableSwitch;
public class PassSettingsActivity extends ThemeActivity implements OnCheckedChangeListener {
private SwitchCompat onSwitch;
private TextView toggleStatus;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
instance = this;
setTheme();
setContentView(R.layout.header_switch_layout);
setToolbar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setFragment(ChanPreferences.getPassEnabled());
findViewById(R.id.toggle_bar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onSwitch.toggle();
}
});
@Override
protected void onDestroy() {
super.onDestroy();
toggleStatus = (TextView) findViewById(R.id.toggle_status);
onSwitch = (SwitchCompat) findViewById(R.id.toggle);
onSwitch.setOnCheckedChangeListener(this);
setSwitch(ChanPreferences.getPassEnabled());
instance = null;
setFragment(ChanPreferences.getPassEnabled());
}
@Override
public void onBackPressed() {
super.onBackPressed();
public void onPause() {
super.onPause();
if (TextUtils.isEmpty(ChanPreferences.getPassId())) {
ChanPreferences.setPassEnabled(false);
setSwitch(false);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.action_bar_switch, menu);
enableSwitch = (Switch) menu.findItem(R.id.action_bar_switch).getActionView();
enableSwitch.setOnCheckedChangeListener(this);
enableSwitch.setPadding(0, 0, Utils.dp(14), 0);
setSwitch(ChanPreferences.getPassEnabled());
return true;
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setFragment(isChecked);
@ -98,19 +89,21 @@ public class PassSettingsActivity extends Activity implements OnCheckedChangeLis
}
private void setSwitch(boolean enabled) {
enableSwitch.setChecked(enabled);
onSwitch.setChecked(enabled);
toggleStatus.setText(enabled ? R.string.on : R.string.off);
ChanPreferences.setPassEnabled(enabled);
}
private void setFragment(boolean enabled) {
if (enabled) {
FragmentTransaction t = getFragmentManager().beginTransaction();
t.replace(android.R.id.content, new PassSettingsFragment());
t.replace(R.id.content, new PassSettingsFragment());
t.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
t.commit();
} else {
FragmentTransaction t = getFragmentManager().beginTransaction();
t.replace(android.R.id.content, new TextFragment());
t.replace(R.id.content, new TextFragment());
t.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
t.commit();
}
@ -144,10 +137,9 @@ public class PassSettingsActivity extends Activity implements OnCheckedChangeLis
login.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
if (PassSettingsActivity.instance != null) {
Pass pass = new Pass(ChanPreferences.getPassToken(), ChanPreferences.getPassPin());
onLoginClick(pass);
}
return true;
}
});

@ -17,42 +17,44 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.MenuItem;
import org.floens.chan.R;
import org.floens.chan.core.model.Loadable;
import org.floens.chan.ui.ThemeActivity;
import org.floens.chan.ui.fragment.ReplyFragment;
import org.floens.chan.utils.Logger;
import org.floens.chan.utils.ThemeHelper;
public class ReplyActivity extends Activity {
public class ReplyActivity extends ThemeActivity {
private static final String TAG = "ReplyActivity";
private static Loadable loadable;
private static Loadable staticLoadable;
public static void setLoadable(Loadable l) {
loadable = l;
staticLoadable = l;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
Loadable loadable = staticLoadable;
staticLoadable = null;
if (loadable != null && savedInstanceState == null) {
getActionBar().setDisplayHomeAsUpEnabled(true);
setTheme();
setContentView(R.layout.toolbar_activity);
setToolbar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(android.R.id.content, ReplyFragment.newInstance(loadable, false), "reply");
ft.replace(R.id.content, ReplyFragment.newInstance(loadable, false), "reply");
ft.commitAllowingStateLoss();
loadable = null;
} else if (savedInstanceState == null) {
Logger.e(TAG, "ThreadFragment was null, exiting!");
Logger.e(TAG, "Loadable was null, exiting!");
finish();
}
}
@ -60,7 +62,7 @@ public class ReplyActivity extends Activity {
@Override
public void onBackPressed() {
Fragment f = getFragmentManager().findFragmentByTag("reply");
if (f != null && ((ReplyFragment)f).onBackPressed()) {
if (f != null && ((ReplyFragment) f).onBackPressed()) {
super.onBackPressed();
}
}

@ -17,17 +17,17 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import org.floens.chan.R;
import org.floens.chan.ui.ThemeActivity;
import org.floens.chan.ui.fragment.SettingsFragment;
import org.floens.chan.utils.ThemeHelper;
public class SettingsActivity extends Activity {
public class SettingsActivity extends ThemeActivity {
private static boolean doingThemeRestart = false;
private static ThemeHelper.Theme lastTheme;
@ -35,15 +35,18 @@ public class SettingsActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme();
setContentView(R.layout.toolbar_activity);
setToolbar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (!doingThemeRestart) {
lastTheme = ThemeHelper.getInstance().getTheme();
}
ThemeHelper.setTheme(this);
SettingsFragment frag = new SettingsFragment();
frag.setArguments(getIntent().getExtras());
getFragmentManager().beginTransaction().replace(android.R.id.content, frag).commit();
getFragmentManager().beginTransaction().replace(R.id.content, frag).commit();
}
public void restart(Intent intent) {
@ -77,6 +80,9 @@ public class SettingsActivity extends Activity {
if (item.getItemId() == R.id.action_settings_advanced) {
startActivity(new Intent(this, AdvancedSettingsActivity.class));
return true;
} else if (item.getItemId() == android.R.id.home) {
finish();
return true;
} else {
return super.onOptionsItemSelected(item);
}

@ -17,56 +17,52 @@
*/
package org.floens.chan.ui.activity;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceFragment;
import android.view.Gravity;
import android.support.v7.widget.SwitchCompat;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;
import org.floens.chan.ChanApplication;
import org.floens.chan.R;
import org.floens.chan.core.ChanPreferences;
import org.floens.chan.utils.ThemeHelper;
import org.floens.chan.utils.Utils;
import org.floens.chan.ui.ThemeActivity;
public class WatchSettingsActivity extends Activity implements OnCheckedChangeListener {
private Switch watchSwitch;
public class WatchSettingsActivity extends ThemeActivity implements OnCheckedChangeListener {
private SwitchCompat watchSwitch;
private TextView toggleStatus;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
setFragment(ChanPreferences.getWatchEnabled());
}
setTheme();
setContentView(R.layout.header_switch_layout);
setToolbar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
findViewById(R.id.toggle_bar).setOnClickListener(new View.OnClickListener() {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.action_bar_switch, menu);
public void onClick(View v) {
watchSwitch.toggle();
}
});
watchSwitch = (Switch) menu.findItem(R.id.action_bar_switch).getActionView();
toggleStatus = (TextView) findViewById(R.id.toggle_status);
watchSwitch = (SwitchCompat) findViewById(R.id.toggle);
watchSwitch.setOnCheckedChangeListener(this);
watchSwitch.setPadding(0, 0, Utils.dp(14), 0);
setSwitch(ChanPreferences.getWatchEnabled());
return true;
setFragment(ChanPreferences.getWatchEnabled());
}
@Override
@ -77,31 +73,21 @@ public class WatchSettingsActivity extends Activity implements OnCheckedChangeLi
private void setSwitch(boolean enabled) {
watchSwitch.setChecked(enabled);
toggleStatus.setText(enabled ? R.string.on : R.string.off);
ChanPreferences.setWatchEnabled(enabled);
watchSwitch.setEnabled(false);
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
watchSwitch.setEnabled(true);
}
}, 500);
}
private void setFragment(boolean enabled) {
if (enabled) {
FragmentTransaction t = getFragmentManager().beginTransaction();
t.replace(android.R.id.content, new WatchSettingsFragment());
t.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
t.commit();
if (enabled) {
t.replace(R.id.content, new WatchSettingsFragment());
} else {
FragmentTransaction t = getFragmentManager().beginTransaction();
t.replace(android.R.id.content, TextFragment.newInstance(R.string.watch_info_text));
t.replace(R.id.content, TextFragment.newInstance(R.string.watch_info_text));
}
t.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
t.commit();
}
}
public static class TextFragment extends Fragment {
public static TextFragment newInstance(int textResource) {
@ -114,18 +100,10 @@ public class WatchSettingsActivity extends Activity implements OnCheckedChangeLi
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle savedInstanceState) {
LinearLayout container = new LinearLayout(inflater.getContext());
ViewGroup container = (ViewGroup) inflater.inflate(R.layout.watch_description, null);
int p = Utils.dp(14);
container.setPadding(p, p, p, p);
TextView text = new TextView(inflater.getContext());
text.setTextSize(20);
TextView text = (TextView) container.findViewById(R.id.text);
text.setText(getArguments().getInt("text_resource"));
text.setGravity(Gravity.CENTER);
container.setGravity(Gravity.CENTER);
container.addView(text);
return container;
}

@ -21,6 +21,7 @@ import android.app.AlertDialog;
import android.app.Fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
@ -82,7 +83,7 @@ public class ImageViewFragment extends Fragment implements ThumbnailImageViewCal
imageView = new ThumbnailImageView(context);
imageView.setCallback(this);
int padding = Utils.dp(8);
int padding = getResources().getDimensionPixelSize(R.dimen.image_view_padding);
imageView.setPadding(padding, padding, padding, padding);
return imageView;
@ -177,10 +178,10 @@ public class ImageViewFragment extends Fragment implements ThumbnailImageViewCal
activity.setProgressBarIndeterminateVisibility(showProgressBar);
String filename = post.filename + "." + post.ext;
activity.getActionBar().setTitle(filename);
activity.getSupportActionBar().setTitle(filename);
String text = (position + 1) + "/" + adapter.getCount();
activity.getActionBar().setSubtitle(text);
activity.getSupportActionBar().setSubtitle(text);
activity.invalidateActionBar();
@ -241,9 +242,13 @@ public class ImageViewFragment extends Fragment implements ThumbnailImageViewCal
break;
case R.id.action_image_save:
case R.id.action_share:
if (ChanPreferences.getImageShareUrl()) {
shareImageUrl(post.imageUrl);
} else {
ImageSaver.getInstance().saveImage(context, post.imageUrl,
ChanPreferences.getImageSaveOriginalFilename() ? Long.toString(post.tim) : post.filename, post.ext,
item.getItemId() == R.id.action_share);
}
break;
default:
// Search if it was an ImageSearch item
@ -258,6 +263,13 @@ public class ImageViewFragment extends Fragment implements ThumbnailImageViewCal
}
}
private void shareImageUrl(String url) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, url);
context.startActivity(Intent.createChooser(intent, context.getString(R.string.action_share)));
}
public void onVideoError(File video) {
if (ChanPreferences.getVideoErrorIgnore()) {
Toast.makeText(context, R.string.image_open_failed, Toast.LENGTH_SHORT).show();

@ -17,12 +17,12 @@
*/
package org.floens.chan.ui.fragment;
import android.app.Activity;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
@ -106,7 +106,7 @@ public class ReplyFragment extends DialogFragment {
private TextView commentCountView;
private TextView fileStatusView;
private Activity context;
private ActionBarActivity context;
public static ReplyFragment newInstance(Loadable loadable, boolean quickMode) {
ReplyFragment reply = new ReplyFragment();
@ -127,7 +127,7 @@ public class ReplyFragment extends DialogFragment {
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
context = getActivity();
context = (ActionBarActivity) getActivity();
if (loadable == null && savedInstanceState != null) {
loadable = new Loadable();
@ -142,7 +142,7 @@ public class ReplyFragment extends DialogFragment {
String title = (loadable.isThreadMode() ? context.getString(R.string.reply) : context.getString(R.string.reply_to_board)) + " " + loadable.title;
if (dialog == null) {
context.getActionBar().setTitle(title);
context.getSupportActionBar().setTitle(title);
} else {
dialog.setTitle(title);
// todo move elsewhere

@ -19,7 +19,6 @@ package org.floens.chan.ui.fragment;
import android.app.Fragment;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.Gravity;
@ -327,13 +326,8 @@ public class ThreadFragment extends Fragment implements ThreadManager.ThreadMana
} else if (viewMode == ThreadManager.ViewMode.GRID) {
GridView grid = new GridView(getActivity());
grid.setNumColumns(GridView.AUTO_FIT);
TypedArray ta = getActivity().obtainStyledAttributes(null, R.styleable.PostView, R.attr.post_style, 0);
int postGridWidth = ta.getDimensionPixelSize(R.styleable.PostView_grid_width, 0);
int postGridSpacing = ta.getDimensionPixelSize(R.styleable.PostView_grid_spacing, 0);
ta.recycle();
int postGridWidth = getActivity().getResources().getDimensionPixelSize(R.dimen.post_grid_width);
grid.setColumnWidth(postGridWidth);
grid.setVerticalSpacing(postGridSpacing);
grid.setHorizontalSpacing(postGridSpacing);
listView = grid;
postAdapter = new PostAdapter(getActivity(), threadManager, listView, this);
listView.setAdapter(postAdapter);

@ -125,7 +125,7 @@ public class ThumbnailImageView extends LoadView implements View.OnClickListener
@Override
public void onProgress(long downloaded, long total, boolean done) {
if (done) {
callback.setLinearProgress(0, 0, true);
// callback.setLinearProgress(0, 0, true);
thumbnailNeeded = false;
} else {
callback.setLinearProgress(downloaded, total, false);

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -20,5 +19,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="200"/>
android:duration="200" />
</set>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -20,5 +19,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="200"/>
android:duration="200" />
</set>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,16 +15,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<inset
xmlns:android="http://schemas.android.com/apk/res/android"
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="8dp"
android:insetTop="8dp"
android:insetRight="8dp"
android:insetBottom="8dp">
<shape>
<solid
android:color="#FF33B5E5"/>
<corners
android:radius="4dp"/>
<solid android:color="#FF33B5E5" />
<corners android:radius="4dp" />
</shape>
</inset>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,16 +15,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<inset
xmlns:android="http://schemas.android.com/apk/res/android"
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="8dp"
android:insetTop="8dp"
android:insetRight="8dp"
android:insetBottom="8dp">
<shape>
<solid
android:color="#FF898989"/>
<corners
android:radius="4dp"/>
<solid android:color="#FF898989" />
<corners android:radius="4dp" />
</shape>
</inset>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,16 +15,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<inset
xmlns:android="http://schemas.android.com/apk/res/android"
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="8dp"
android:insetTop="8dp"
android:insetRight="8dp"
android:insetBottom="8dp">
<shape>
<solid
android:color="#FFFF4444"/>
<corners
android:radius="4dp"/>
<solid android:color="#FFFF4444" />
<corners android:radius="4dp" />
</shape>
</inset>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,31 +15,39 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar" />
<android.support.v4.widget.SlidingPaneLayout
android:id="@+id/pane_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/left_pane"
android:layout_width="100dp"
android:layout_height="match_parent"
style="?board_pane_left_style"/>
style="?board_pane_left_style" />
<FrameLayout
android:id="@+id/right_pane"
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_weight="1"
style="?board_pane_right_style"/>
style="?board_pane_right_style" />
</android.support.v4.widget.SlidingPaneLayout>
</LinearLayout>
<ListView
android:id="@+id/left_drawer"
android:layout_width="280dp"
@ -49,6 +56,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:background="#444"
android:choiceMode="singleChoice"
android:divider="#333"
android:dividerHeight="1dp"/>
android:dividerHeight="1dp" />
</android.support.v4.widget.DrawerLayout>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,8 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
@ -30,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:paddingBottom="12dp"
android:paddingLeft="16dp"
android:paddingTop="12dp"
style="?attr/board_edit_item_style"/>
style="?attr/board_edit_item_style" />
<TextView
android:id="@+id/text"
@ -39,6 +37,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:layout_marginLeft="36dp"
android:gravity="center_vertical"
android:minHeight="50sp"
android:textSize="24sp"/>
android:textSize="24sp" />
</FrameLayout>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,17 +15,16 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#FFF3F3F3"
android:textColor="#ff000000"
android:gravity="center_vertical"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:textStyle="italic"
android:singleLine="true"
android:ellipsize="end"/>
android:ellipsize="end" />

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,16 +15,15 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#FFF3F3F3"
android:textColor="#ffffffff"
android:gravity="center_vertical"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:singleLine="true"
android:ellipsize="end"/>
android:ellipsize="end" />

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#ff000000"
android:gravity="center_vertical"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:singleLine="true"
android:ellipsize="end" />

@ -85,7 +85,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<View
android:layout_width="fill_parent"
android:layout_height="3dp"
android:background="@android:color/darker_gray"/>
android:background="@android:color/darker_gray" />
<ListView
android:id="@+id/folder_list"

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar" />
<LinearLayout
android:id="@+id/toggle_bar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="#ff9e9e9e"
android:orientation="horizontal">
<TextView
android:id="@+id/toggle_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="6dip"
android:layout_marginLeft="24dp"
android:layout_marginRight="6dip"
android:layout_marginTop="6dip"
android:layout_weight="1"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffffff" />
<android.support.v7.widget.SwitchCompat
android:id="@+id/toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:clickable="true"
android:focusable="false"
android:paddingRight="20dp" />
</LinearLayout>
<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/black"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.floens.chan.ui.view.HackyViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/image_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-7dp" />
</FrameLayout>
</LinearLayout>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,21 +15,19 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
android:gravity="center"
android:padding="24dp">
<TextView
android:id="@+id/pass_info"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="16dp"
android:text="@string/pass_info_text"
android:textSize="24sp"/>
style="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/pass_link"
@ -42,6 +39,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:text="@string/pass_info_learn_more"
android:textColor="@android:color/holo_blue_light"
android:textSize="20sp"
android:textStyle="italic"/>
android:textStyle="italic" />
</LinearLayout>

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:popupTheme="?attr/toolbar_popup_theme"
app:theme="?attr/toolbar_theme" />

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,18 +15,16 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/image_list_background"
android:orientation="vertical">
android:layout_height="match_parent">
<org.floens.chan.ui.view.HackyViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/image_pager"
<include layout="@layout/toolbar" />
<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</org.floens.chan.ui.view.HackyViewPager>
</RelativeLayout>
android:layout_height="wrap_content" />
</LinearLayout>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:gravity="center">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
style="?android:attr/textAppearanceMedium" />
</LinearLayout>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,13 +15,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_bar_switch"
android:title=""
android:actionViewClass="android.widget.Switch"
android:showAsAction="always">
</item>
app:showAsAction="always" />
</menu>

@ -15,12 +15,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_reload_tablet"
android:icon="@drawable/ic_action_refresh"
android:orderInCategory="1"
android:showAsAction="always"
app:showAsAction="always"
android:title="@string/action_reload">
<menu>
<item
@ -36,28 +37,28 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:id="@+id/action_reload_board"
android:icon="@drawable/ic_action_refresh"
android:orderInCategory="1"
android:showAsAction="always"
app:showAsAction="always"
android:title="@string/action_reload_board" />
<item
android:id="@+id/action_pin"
android:icon="@drawable/ic_action_make_available_offline"
android:icon="@drawable/ic_bookmark"
android:orderInCategory="2"
android:showAsAction="always"
app:showAsAction="always"
android:title="@string/action_pin" />
<item
android:id="@+id/action_reply"
android:icon="@drawable/ic_action_chat"
android:icon="@drawable/ic_action_write"
android:orderInCategory="4"
android:showAsAction="ifRoom"
app:showAsAction="ifRoom"
android:title="@string/action_reply" />
<item
android:id="@+id/action_reply_tablet"
android:icon="@drawable/ic_action_chat"
android:icon="@drawable/ic_action_write"
android:orderInCategory="4"
android:showAsAction="ifRoom"
app:showAsAction="ifRoom"
android:title="@string/action_reply">
<menu>
<item
@ -74,7 +75,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:id="@+id/action_reload_thread"
android:icon="@drawable/ic_action_refresh"
android:orderInCategory="5"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_reload" />
<item
@ -85,7 +86,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<item
android:id="@+id/action_search_tablet"
android:orderInCategory="6"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_search">
<menu>
<item
@ -102,25 +103,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:id="@+id/action_share"
android:actionProviderClass="android.widget.ShareActionProvider"
android:orderInCategory="7"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_share" />
<item
android:id="@+id/action_download_album"
android:orderInCategory="8"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_download_album" />
<item
android:id="@+id/action_open_browser"
android:orderInCategory="9"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_open_browser" />
<item
android:id="@+id/action_board_view_mode"
android:orderInCategory="10"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_board_view_mode">
<menu>
<group android:checkableBehavior="single">
@ -137,7 +138,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_settings" />
</menu>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,18 +15,19 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_add_board"
android:icon="@drawable/ic_action_new"
android:showAsAction="always"
android:title="@string/board_add"/>
app:showAsAction="always"
android:title="@string/board_add" />
<item
android:id="@+id/action_show_filler"
android:showAsAction="never"
app:showAsAction="never"
android:checkable="true"
android:title="@string/board_edit_enable_filler"/>
android:title="@string/board_edit_enable_filler" />
</menu>

@ -15,40 +15,41 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_image_play_state"
android:icon="@drawable/ic_action_play"
android:orderInCategory="1"
android:showAsAction="always"
app:showAsAction="always"
android:title="@string/image_play_state" />
<item
android:id="@+id/action_image_save"
android:orderInCategory="2"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/image_save" />
<item
android:id="@+id/action_open_browser"
android:orderInCategory="3"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_open_browser" />
<item
android:id="@+id/action_share"
android:orderInCategory="4"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_share" />
<item
android:id="@+id/action_image_search"
android:orderInCategory="5"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_search_image">
<menu></menu>
</item>
<item
android:id="@+id/action_download_album"
android:orderInCategory="6"
android:showAsAction="never"
app:showAsAction="never"
android:title="@string/action_download_album" />
</menu>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -16,10 +15,11 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings_advanced"
android:orderInCategory="1"
android:showAsAction="never"
android:title="@string/action_settings_advanced"/>
app:showAsAction="never"
android:title="@string/action_settings_advanced" />
</menu>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -17,60 +16,63 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<attr name="board_pane_style" format="reference"/>
<attr name="board_pane_left_style" format="reference"/>
<attr name="board_pane_right_style" format="reference"/>
<attr name="toolbar_theme" format="reference" />
<attr name="toolbar_popup_theme" format="reference" />
<attr name="board_pane_style" format="reference" />
<attr name="board_pane_left_style" format="reference" />
<attr name="board_pane_right_style" format="reference" />
<declare-styleable name="BoardPane">
<attr name="fade_color" format="color"/>
<attr name="fade_color" format="color" />
</declare-styleable>
<attr name="post_style" format="reference"/>
<attr name="post_style" format="reference" />
<declare-styleable name="PostView">
<attr name="thumbnail_background" format="color"/>
<attr name="saved_reply_color" format="color"/>
<attr name="highlighted_color" format="color"/>
<attr name="reply_count_color" format="color"/>
<attr name="name_color" format="color"/>
<attr name="subject_color" format="color"/>
<attr name="date_color" format="color"/>
<attr name="quote_color" format="color"/>
<attr name="highlight_quote_color" format="color"/>
<attr name="link_color" format="color"/>
<attr name="spoiler_color" format="color"/>
<attr name="capcode_color" format="color"/>
<attr name="id_background_light" format="color"/>
<attr name="id_background_dark" format="color"/>
<attr name="inline_quote_color" format="color"/>
<attr name="thumbnail_background" format="color" />
<attr name="saved_reply_color" format="color" />
<attr name="highlighted_color" format="color" />
<attr name="reply_count_color" format="color" />
<attr name="name_color" format="color" />
<attr name="subject_color" format="color" />
<attr name="date_color" format="color" />
<attr name="quote_color" format="color" />
<attr name="highlight_quote_color" format="color" />
<attr name="link_color" format="color" />
<attr name="spoiler_color" format="color" />
<attr name="capcode_color" format="color" />
<attr name="id_background_light" format="color" />
<attr name="id_background_dark" format="color" />
<attr name="inline_quote_color" format="color" />
<attr name="title_size" format="dimension"/>
<attr name="detail_size" format="dimension"/>
<attr name="icon_padding" format="dimension"/>
<attr name="icon_width" format="dimension"/>
<attr name="icon_height" format="dimension"/>
<attr name="options_spacing" format="dimension"/>
<attr name="options_left_padding" format="dimension"/>
<attr name="options_top_padding" format="dimension"/>
<attr name="options_right_padding" format="dimension"/>
<attr name="options_bottom_padding" format="dimension"/>
<attr name="last_seen_height" format="dimension"/>
<attr name="grid_padding" format="dimension"/>
<attr name="grid_image_size" format="dimension"/>
<attr name="grid_comment_padding" format="dimension"/>
<attr name="grid_replies_count_size" format="dimension"/>
<attr name="list_comment_max_height" format="dimension"/>
<attr name="list_padding" format="dimension"/>
<attr name="list_image_size" format="dimension"/>
<attr name="list_comment_padding" format="dimension"/>
<attr name="list_replies_count_size" format="dimension"/>
<attr name="grid_width" format="dimension"/>
<attr name="grid_height" format="dimension"/>
<attr name="grid_spacing" format="dimension"/>
<attr name="title_size" format="dimension" />
<attr name="detail_size" format="dimension" />
<attr name="icon_padding" format="dimension" />
<attr name="icon_width" format="dimension" />
<attr name="icon_height" format="dimension" />
<attr name="options_spacing" format="dimension" />
<attr name="options_left_padding" format="dimension" />
<attr name="options_top_padding" format="dimension" />
<attr name="options_right_padding" format="dimension" />
<attr name="options_bottom_padding" format="dimension" />
<attr name="last_seen_height" format="dimension" />
<attr name="grid_padding" format="dimension" />
<attr name="grid_image_size" format="dimension" />
<attr name="grid_comment_padding" format="dimension" />
<attr name="grid_replies_count_size" format="dimension" />
<attr name="list_comment_max_height" format="dimension" />
<attr name="list_padding" format="dimension" />
<attr name="list_image_size" format="dimension" />
<attr name="list_comment_padding" format="dimension" />
<attr name="list_replies_count_size" format="dimension" />
<attr name="grid_width" format="dimension" />
<attr name="grid_height" format="dimension" />
<attr name="grid_spacing" format="dimension" />
<attr name="code_tag_size" format="dimension"/>
<attr name="code_tag_size" format="dimension" />
</declare-styleable>
<attr name="board_edit_item_style" format="reference"/>
<attr name="board_edit_item_style" format="reference" />
</resources>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -17,5 +16,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<color name="primary">#ff4caf50</color>
<color name="primary_dark">#ff388e3c</color>
<color name="holo_blue_dark">#ff0099cc</color>
<color name="image_view_background">#bb000000</color>
</resources>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -17,4 +16,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<dimen name="navdrawer_width">260dp</dimen>
<dimen name="image_view_padding">4dp</dimen>
<dimen name="post_grid_width">90dp</dimen>
<!--<dimen name="post_grid_height">300dp</dimen>-->
</resources>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -25,6 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<string name="close">Close</string>
<string name="back">Back</string>
<string name="ok">OK</string>
<string name="on">On</string>
<string name="off">Off</string>
<string name="action_settings">Settings</string>
<string name="action_reload">Reload</string>
@ -193,6 +194,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<string name="preference_image_save_location">Image save folder</string>
<string name="preference_network_https">Use HTTPS</string>
<string name="preference_image_save_original">Save original filename</string>
<string name="preference_image_share_url">Share url to image</string>
<string name="preference_open_link_confirmation">Ask before opening links</string>
<string name="preference_autoplay">Start playing videos immediately</string>
<string name="preference_auto_refresh_thread">Auto refresh threads</string>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -18,17 +17,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<style name="Theme.ImageList" parent="AppTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
<style name="Chan.Theme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent_material_light</item>
<color name="image_list_background">#88000000</color>
<item name="windowActionModeOverlay">true</item>
</style>
<style name="Chan.ImageView" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@color/image_view_background</item>
<item name="android:windowIsTranslucent">true</item>
<!--<item name="android:backgroundDimEnabled">true</item>-->
</style>
<!-- Light theme -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<style name="AppTheme" parent="Chan.Theme">
<item name="board_pane_style">@style/BoardPane</item>
<item name="board_pane_left_style">@style/BoardLeftPane</item>
<item name="board_pane_right_style">@style/BoardRightPane</item>
@ -36,8 +40,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<item name="post_style">@style/PostView</item>
<item name="board_edit_item_style">@style/BoardEditItem</item>
</style>
<item name="android:textColor">#ff000000</item>
<item name="toolbar_theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
<item name="toolbar_popup_theme">@style/ThemeOverlay.AppCompat.Light</item>
</style>
<!-- Dark theme -->
<style name="AppTheme.Dark" parent="android:Theme.Holo">
@ -75,14 +83,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</style>
<style name="BoardRightPane">
<item name="android:background">#FFE5E5E5</item>
<item name="android:background">#FFFFFFFF</item>
</style>
<style name="PostView">
<item name="grid_width">90dp</item>
<item name="grid_height">300dp</item>
<item name="grid_spacing">0dp</item>
<item name="title_size">14sp</item>
<item name="detail_size">10sp</item>
<item name="icon_padding">6dp</item>

@ -25,6 +25,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:key="preference_image_save_original"
android:title="@string/preference_image_save_original" />
<CheckBoxPreference
android:defaultValue="false"
android:key="preference_image_share_url"
android:title="@string/preference_image_share_url" />
<CheckBoxPreference
android:defaultValue="true"
android:key="preference_network_https"

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
@ -20,15 +19,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<EditTextPreference
android:key="preference_pass_token"
android:title="@string/pass_token"/>
android:title="@string/pass_token" />
<EditTextPreference
android:key="preference_pass_pin"
android:title="@string/pass_pin"
android:inputType="numberPassword"/>
android:inputType="numberPassword" />
<Preference
android:key="preference_pass_login"
android:title="@string/pass_login"/>
android:title="@string/pass_login" />
</PreferenceScreen>

Loading…
Cancel
Save