Permalink
Browse files

+ feature to hide sensitive contents

+ feature to mark photos uploaded as sensitive
  • Loading branch information...
1 parent 0491b80 commit caf372ba258ca4333fa65a9ac012d59835b849c3 @mariotaku committed Dec 23, 2012
Showing with 272 additions and 787 deletions.
  1. BIN libs/twitter4j-android-core-2.2.6.jar
  2. BIN res/drawable-nodpi/image_preview_nsfw.png
  3. BIN res/drawable-xhdpi/ic_menu_report_image.png
  4. BIN res/drawable-zh-rCN-nodpi/image_preview_nsfw.jpg
  5. +4 −0 res/menu/menu_compose.xml
  6. +0 −461 res/values/gallery_strings.xml
  7. +1 −0 res/values/ids.xml
  8. +6 −0 res/values/strings.xml
  9. +7 −1 res/xml/settings_content_and_storage.xml
  10. +2 −40 src/org/mariotaku/gallery3d/app/ImageViewerGLActivity.java
  11. +1 −1 src/org/mariotaku/gallery3d/app/SinglePhotoDataAdapter.java
  12. +6 −131 src/org/mariotaku/gallery3d/ui/PhotoView.java
  13. +4 −82 src/org/mariotaku/gallery3d/ui/PositionController.java
  14. +3 −1 src/org/mariotaku/twidere/Constants.java
  15. +43 −13 src/org/mariotaku/twidere/activity/ComposeActivity.java
  16. +2 −2 src/org/mariotaku/twidere/activity/DraftsActivity.java
  17. +16 −17 src/org/mariotaku/twidere/adapter/CursorStatusesAdapter.java
  18. +15 −3 src/org/mariotaku/twidere/adapter/ParcelableStatusesAdapter.java
  19. +2 −0 src/org/mariotaku/twidere/adapter/iface/IStatusesAdapter.java
  20. +3 −0 src/org/mariotaku/twidere/fragment/BaseStatusesListFragment.java
  21. +1 −1 src/org/mariotaku/twidere/fragment/CursorStatusesListFragment.java
  22. +52 −0 src/org/mariotaku/twidere/fragment/SensitiveContentWaringDialogFragment.java
  23. +5 −4 src/org/mariotaku/twidere/fragment/StatusFragment.java
  24. +2 −2 src/org/mariotaku/twidere/fragment/UserProfileFragment.java
  25. +4 −1 src/org/mariotaku/twidere/model/DraftItem.java
  26. +5 −0 src/org/mariotaku/twidere/model/ParcelableLocation.java
  27. +9 −6 src/org/mariotaku/twidere/model/ParcelableStatus.java
  28. +4 −2 src/org/mariotaku/twidere/model/StatusCursorIndices.java
  29. +12 −5 src/org/mariotaku/twidere/provider/TweetStore.java
  30. +0 −1 src/org/mariotaku/twidere/provider/TweetStoreProvider.java
  31. +7 −4 src/org/mariotaku/twidere/util/AsyncTwitterWrapper.java
  32. +7 −1 src/org/mariotaku/twidere/util/OnLinkClickHandler.java
  33. +19 −3 src/org/mariotaku/twidere/util/Utils.java
  34. +15 −1 src/org/mariotaku/twidere/util/imageloader/ImageWorker.java
  35. +15 −4 src/org/mariotaku/twidere/view/StatusImagePreviewLayout.java
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -18,6 +18,10 @@
android:icon="@drawable/ic_menu_more"
android:title="@string/more">
<menu>
+ <item
+ android:id="@id/toggle_sensitive"
+ android:icon="@drawable/ic_menu_report_image"
+ android:title="@string/mark_as_sensitive"/>
<item
android:id="@id/extensions"
android:icon="@drawable/ic_menu_extension"

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -52,5 +52,6 @@
<item name="load_from_position" type="id"/>
<item name="right_pane" type="id"/>
<item name="right_pane_container" type="id"/>
+ <item name="toggle_sensitive" type="id"/>
</resources>
View
@@ -370,5 +370,11 @@
<string name="hashtag">Hashtag</string>
<string name="links">Links</string>
<string name="edit_profile">Edit profile</string>
+ <string name="display_sensitive_contents">Display sensitive contents</string>
+ <string name="display_sensitive_contents_summary">Display sensitive contents without notice in timeline</string>
+ <string name="sensitive_content_warning">This tweet may have sensitive content, continue?</string>
+ <string name="mark_as_sensitive">Mark as sensitive</string>
+ <string name="remove_sensitive_mark">Remove sensitive mark</string>
+ <string name="loading">Loading…</string>
</resources>
@@ -72,6 +72,12 @@
android:key="trends_location"
android:summary="@string/trends_location_summary"
android:title="@string/trends_location"/>
+
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="display_sensitive_contents"
+ android:summary="@string/display_sensitive_contents_summary"
+ android:title="@string/display_sensitive_contents"/>
</PreferenceCategory>
<PreferenceCategory
android:key="category_storage"
@@ -97,4 +103,4 @@
android:title="@string/clear_databases"/>
</PreferenceCategory>
-</PreferenceScreen>
+</PreferenceScreen>
@@ -35,9 +35,6 @@
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnCancelListener;
-import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
@@ -55,7 +52,6 @@
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
-import android.widget.Toast;
public final class ImageViewerGLActivity extends FragmentActivity implements Constants, View.OnClickListener,
GalleryContext, PhotoView.Listener, OrientationManager.Listener {
@@ -82,8 +78,6 @@ public void onReceive(final Context context, final Intent intent) {
}
};
- private final IntentFilter mMountFilter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED);
-
protected static final int FLAG_HIDE_ACTION_BAR = 1;
protected static final int FLAG_HIDE_STATUS_BAR = 2;
protected static final int FLAG_SCREEN_ON_WHEN_PLUGGED = 4;
@@ -167,9 +161,6 @@ public void onReceive(final Context context, final Intent intent) {
private boolean mIsMenuVisible;
private MediaItem mCurrentPhoto = null;
- // This is the original mSetPathString before adding the camera preview
- // item.
- private final boolean mHasCameraScreennailOrPlaceholder = false;
private final long mDeferUpdateUntil = Long.MAX_VALUE;
private final GLView mRootPane = new GLView() {
@Override
@@ -263,12 +254,11 @@ public void onOrientationCompensationChanged() {
}
@Override
- public void onPictureCenter(boolean isCamera) {
- isCamera = isCamera || mHasCameraScreennailOrPlaceholder && null == null;
+ public void onPictureCenter() {
mPhotoView.setWantPictureCenterCallbacks(false);
mHandler.removeMessages(MSG_ON_CAMERA_CENTER);
mHandler.removeMessages(MSG_ON_PICTURE_CENTER);
- mHandler.sendEmptyMessage(isCamera ? MSG_ON_CAMERA_CENTER : MSG_ON_PICTURE_CENTER);
+ mHandler.sendEmptyMessage(MSG_ON_PICTURE_CENTER);
}
// //////////////////////////////////////////////////////////////////////////
@@ -501,33 +491,6 @@ protected void onSaveInstanceState(final Bundle outState) {
}
}
- @Override
- protected void onStart() {
- super.onStart();
- if (getExternalCacheDir() == null) {
- final OnCancelListener onCancel = new OnCancelListener() {
- @Override
- public void onCancel(final DialogInterface dialog) {
- finish();
- }
- };
- final OnClickListener onClick = new OnClickListener() {
- @Override
- public void onClick(final DialogInterface dialog, final int which) {
- dialog.cancel();
- }
- };
- final AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.no_external_storage_title);
- builder.setMessage(R.string.no_external_storage);
- builder.setNegativeButton(android.R.string.cancel, onClick);
- builder.setOnCancelListener(onCancel);
- builder.setIcon(android.R.drawable.ic_dialog_alert);
- mAlertDialog = builder.show();
- registerReceiver(mMountReceiver, mMountFilter);
- }
- }
-
@Override
protected void onStop() {
super.onStop();
@@ -682,7 +645,6 @@ private void startViewAction(final Intent intent) {
// return;
}
if (uri == null) {
- Toast.makeText(this, R.string.no_such_item, Toast.LENGTH_LONG).show();
finish();
} else {
final Path itemPath = dm.findPathByUri(uri, contentType);
@@ -134,7 +134,7 @@ private void onDecodeLargeComplete(final ImageBundle bundle) {
try {
setScreenNail(bundle.backupImage, bundle.decoder.getWidth(), bundle.decoder.getHeight());
setRegionDecoder(bundle.decoder);
- mPhotoView.notifyImageChange(0);
+ mPhotoView.notifyImageChange();
} catch (final Throwable t) {
Log.w(TAG, "fail to decode large", t);
}
Oops, something went wrong.

0 comments on commit caf372b

Please sign in to comment.