Merge branch 'bes-material' into material

material
Floens 11 years ago
commit 3def1b92b1
  1. 2
      Clover/app/src/main/java/org/floens/chan/chan/ImageSearch.java
  2. 4
      Clover/app/src/main/java/org/floens/chan/core/ChanPreferences.java
  3. 2
      Clover/app/src/main/java/org/floens/chan/core/model/PostLinkable.java
  4. 2
      Clover/app/src/main/java/org/floens/chan/ui/activity/AdvancedSettingsActivity.java
  5. 18
      Clover/app/src/main/java/org/floens/chan/ui/activity/BaseActivity.java
  6. 2
      Clover/app/src/main/java/org/floens/chan/ui/activity/BoardEditor.java
  7. 18
      Clover/app/src/main/java/org/floens/chan/ui/activity/ChanActivity.java
  8. 2
      Clover/app/src/main/java/org/floens/chan/ui/activity/ReplyActivity.java
  9. 18
      Clover/app/src/main/java/org/floens/chan/ui/fragment/ImageViewFragment.java
  10. 5
      Clover/app/src/main/res/anim/fade_in.xml
  11. 5
      Clover/app/src/main/res/anim/fade_out.xml
  12. 12
      Clover/app/src/main/res/drawable/pin_icon_blue.xml
  13. 12
      Clover/app/src/main/res/drawable/pin_icon_gray.xml
  14. 12
      Clover/app/src/main/res/drawable/pin_icon_red.xml
  15. 10
      Clover/app/src/main/res/layout/board_edit_item.xml
  16. 8
      Clover/app/src/main/res/layout/board_select_add.xml
  17. 8
      Clover/app/src/main/res/layout/board_select_spinner.xml
  18. 8
      Clover/app/src/main/res/layout/board_select_spinner_dropdown.xml
  19. 2
      Clover/app/src/main/res/layout/folder_pick.xml
  20. 3
      Clover/app/src/main/res/layout/image_view.xml
  21. 5
      Clover/app/src/main/res/menu/settings.xml
  22. 3
      Clover/app/src/main/res/values/colors.xml
  23. 3
      Clover/app/src/main/res/values/dimens.xml
  24. 4
      Clover/app/src/main/res/values/strings.xml
  25. 5
      Clover/app/src/main/res/xml/preference_advanced.xml
  26. 9
      Clover/app/src/main/res/xml/preference_pass.xml

@ -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());

@ -114,7 +114,7 @@ public class AdvancedSettingsActivity extends ThemeActivity {
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;
}

@ -113,6 +113,15 @@ public abstract class BaseActivity extends ThemeActivity implements PanelSlideLi
updateIcon();
}
@Override
public void onBackPressed() {
if (pinDrawer.isDrawerOpen(pinDrawerView)) {
pinDrawer.closeDrawer(pinDrawerView);
} else {
super.onBackPressed();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
@ -364,12 +373,9 @@ public abstract class BaseActivity extends ThemeActivity implements PanelSlideLi
* @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);
}
/**

@ -152,7 +152,7 @@ public class BoardEditor extends ThemeActivity {
}
});
((ViewGroup)findViewById(R.id.content)).addView(listView);
((ViewGroup) findViewById(R.id.content)).addView(listView);
}
@Override

@ -201,10 +201,14 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
@Override
public void onBackPressed() {
if (threadPane.isOpen()) {
super.onBackPressed();
if (pinDrawer.isDrawerOpen(pinDrawerView)) {
pinDrawer.closeDrawer(pinDrawerView);
} else {
threadPane.openPane();
if (threadPane.isOpen()) {
super.onBackPressed();
} else {
threadPane.openPane();
}
}
}
@ -482,8 +486,12 @@ public class ChanActivity extends BaseActivity implements AdapterView.OnItemSele
if (threadFragment.hasLoader()) {
Loader loader = threadFragment.getLoader();
if (loader != null && loader.getLoadable().isThreadMode() && loader.getThread() != null) {
ChanApplication.getWatchManager().addPin(loader.getLoadable(), loader.getThread().op);
pinDrawer.openDrawer(pinDrawerView);
Pin pin = ChanApplication.getWatchManager().findPinByLoadable(threadLoadable);
if (pin != null) {
ChanApplication.getWatchManager().removePin(pin);
} else {
ChanApplication.getWatchManager().addPin(loader.getLoadable(), loader.getThread().op);
}
updateActionBarState();
}
}

@ -62,7 +62,7 @@ public class ReplyActivity extends ThemeActivity {
@Override
public void onBackPressed() {
Fragment f = getFragmentManager().findFragmentByTag("reply");
if (f != null && ((ReplyFragment)f).onBackPressed()) {
if (f != null && ((ReplyFragment) f).onBackPressed()) {
super.onBackPressed();
}
}

@ -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;
@ -241,9 +242,13 @@ public class ImageViewFragment extends Fragment implements ThumbnailImageViewCal
break;
case R.id.action_image_save:
case R.id.action_share:
ImageSaver.getInstance().saveImage(context, post.imageUrl,
ChanPreferences.getImageSaveOriginalFilename() ? Long.toString(post.tim) : post.filename, post.ext,
item.getItemId() == 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();

@ -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>

@ -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,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,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/>.
-->
<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"
@ -29,4 +27,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
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,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/>.
-->
<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"
@ -28,4 +26,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
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,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/>.
-->
<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"
@ -28,4 +26,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:singleLine="true"
android:ellipsize="end"/>
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"

@ -41,7 +41,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
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
@ -22,5 +21,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:id="@+id/action_settings_advanced"
android:orderInCategory="1"
app:showAsAction="never"
android:title="@string/action_settings_advanced"/>
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

@ -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

@ -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
@ -195,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>

@ -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