├── Ninja
├── .idea
│ ├── .name
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── dictionaries
│ │ └── matthew.xml
│ ├── vcs.xml
│ ├── modules.xml
│ ├── compiler.xml
│ └── misc.xml
├── libs
│ └── android-support-v4.jar
├── res
│ ├── drawable-xxhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_action_cl_dark.png
│ │ ├── ic_action_clear.png
│ │ ├── ic_action_cl_active.png
│ │ ├── ic_action_cl_light.png
│ │ ├── ic_action_done_all.png
│ │ ├── ic_action_up_active.png
│ │ ├── ic_action_add_active.png
│ │ ├── ic_action_add_default.png
│ │ ├── ic_action_background.png
│ │ ├── ic_action_down_active.png
│ │ ├── ic_action_down_default.png
│ │ ├── ic_action_up_default.png
│ │ ├── ic_notification_ninja.png
│ │ ├── ic_action_history_active.png
│ │ ├── ic_action_refresh_active.png
│ │ ├── ic_action_setting_active.png
│ │ ├── ic_action_history_default.png
│ │ ├── ic_action_overflow_active.png
│ │ ├── ic_action_overflow_default.png
│ │ ├── ic_action_refresh_default.png
│ │ ├── ic_action_setting_default.png
│ │ ├── ic_action_bookmark_active_blue.png
│ │ ├── ic_action_bookmark_active_dark.png
│ │ ├── ic_action_bookmark_default_blue.png
│ │ ├── ic_action_bookmark_default_dark.png
│ │ └── ic_action_bookmark_default_light.png
│ ├── drawable-xxxhdpi
│ │ └── ic_launcher.png
│ ├── values
│ │ ├── id.xml
│ │ ├── integers.xml
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── styles.xml
│ │ ├── strings_key.xml
│ │ └── arrays.xml
│ ├── menu
│ │ ├── token_menu.xml
│ │ ├── setting_menu.xml
│ │ ├── clear_menu.xml
│ │ ├── whilelist_menu.xml
│ │ └── readability_menu.xml
│ ├── xml
│ │ ├── searchable.xml
│ │ └── preference_clear.xml
│ ├── drawable
│ │ ├── album_shape_blue.xml
│ │ ├── album_shape_dark.xml
│ │ ├── grid_item_shape.xml
│ │ ├── round_corner_shape_light.xml
│ │ ├── round_corner_shape_white.xml
│ │ ├── shadow_above.xml
│ │ ├── shadow_below.xml
│ │ ├── drop_down_shape.xml
│ │ ├── cl_selector_dark.xml
│ │ ├── up_selector.xml
│ │ ├── add_selector.xml
│ │ ├── cl_selector_light.xml
│ │ ├── down_selector.xml
│ │ ├── history_selector.xml
│ │ ├── refresh_selector.xml
│ │ ├── setting_selector.xml
│ │ ├── overflow_selector.xml
│ │ ├── bookmark_selector_blue.xml
│ │ ├── bookmark_selector_dark.xml
│ │ ├── bookmark_selector_light.xml
│ │ └── progress_bar_layer_list.xml
│ ├── anim
│ │ ├── album_slide_in_up.xml
│ │ └── album_fade_out.xml
│ ├── layout-v21
│ │ ├── dialog_list.xml
│ │ ├── dialog_desc.xml
│ │ └── dialog_edit.xml
│ ├── layout
│ │ ├── dialog_list.xml
│ │ ├── dialog_desc.xml
│ │ ├── dialog_text_item.xml
│ │ ├── record_list.xml
│ │ ├── dialog_edit.xml
│ │ ├── whitelist_item.xml
│ │ ├── readability.xml
│ │ ├── grid_item.xml
│ │ ├── complete_item.xml
│ │ ├── home.xml
│ │ ├── album.xml
│ │ ├── dialog_sign_in.xml
│ │ ├── dialog_license_item.xml
│ │ ├── token.xml
│ │ ├── record_item.xml
│ │ └── whitelist.xml
│ ├── values-zh-rCN
│ │ └── arrays.xml
│ ├── values-zh-rTW
│ │ └── arrays.xml
│ ├── values-fr
│ │ └── arrays.xml
│ └── values-v21
│ │ └── styles.xml
├── src
│ ├── io
│ │ └── github
│ │ │ └── mthli
│ │ │ └── Ninja
│ │ │ ├── Browser
│ │ │ ├── AlbumController.java
│ │ │ ├── NinjaClickHandler.java
│ │ │ ├── NinjaGestureListener.java
│ │ │ ├── BrowserController.java
│ │ │ ├── NinjaDownloadListener.java
│ │ │ ├── BrowserContainer.java
│ │ │ ├── NinjaWebChromeClient.java
│ │ │ └── AdBlock.java
│ │ │ ├── View
│ │ │ ├── FullscreenHolder.java
│ │ │ ├── NinjaContextWrapper.java
│ │ │ ├── NinjaToast.java
│ │ │ ├── GridItem.java
│ │ │ ├── DialogAdapter.java
│ │ │ ├── RecordAdapter.java
│ │ │ ├── GridAdapter.java
│ │ │ ├── WhitelistAdapter.java
│ │ │ ├── NinjaRelativeLayout.java
│ │ │ ├── Album.java
│ │ │ ├── UserAgentListPreference.java
│ │ │ ├── SearchEngineListPreference.java
│ │ │ └── SwipeToBoundListener.java
│ │ │ ├── Database
│ │ │ ├── Record.java
│ │ │ └── RecordHelper.java
│ │ │ ├── Fragment
│ │ │ └── ClearFragment.java
│ │ │ ├── Task
│ │ │ ├── ExportBookmarksTask.java
│ │ │ ├── ExportWhitelistTask.java
│ │ │ ├── ImportBookmarksTask.java
│ │ │ ├── ImportWhitelistTask.java
│ │ │ ├── ScreenshotTask.java
│ │ │ └── ReadabilityTask.java
│ │ │ ├── Service
│ │ │ ├── ClearService.java
│ │ │ └── HolderService.java
│ │ │ ├── Unit
│ │ │ ├── RecordUnit.java
│ │ │ ├── NotificationUnit.java
│ │ │ ├── IntentUnit.java
│ │ │ └── ViewUnit.java
│ │ │ └── Activity
│ │ │ ├── TokenActivity.java
│ │ │ ├── SettingActivity.java
│ │ │ ├── ClearActivity.java
│ │ │ └── WhitelistActivity.java
│ └── org
│ │ └── askerov
│ │ └── dynamicgrid
│ │ ├── DynamicGridAdapterInterface.java
│ │ ├── DynamicGridUtils.java
│ │ ├── AbstractDynamicGridAdapter.java
│ │ └── BaseDynamicGridAdapter.java
├── project.properties
├── ant.properties
├── proguard-project.txt
├── Ninja.iml
├── assets
│ ├── ninja_introduction_zh.md
│ ├── ninja_introduction_en.md
│ ├── ninja_introduction_zh.html
│ └── ninja_introduction_en.html
├── build.xml
└── AndroidManifest.xml
├── Art
├── icon
│ ├── Ninja.ai
│ ├── Ninja.png
│ └── Ninja.psd
├── info
│ └── reject.png
└── screenshot
│ ├── dribbble.png
│ ├── overflow.png
│ ├── settings.png
│ ├── background.png
│ ├── .directory
│ └── tab_switcher.png
└── .gitignore
/Ninja/.idea/.name:
--------------------------------------------------------------------------------
1 | Ninja
--------------------------------------------------------------------------------
/Art/icon/Ninja.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/icon/Ninja.ai
--------------------------------------------------------------------------------
/Art/icon/Ninja.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/icon/Ninja.png
--------------------------------------------------------------------------------
/Art/icon/Ninja.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/icon/Ninja.psd
--------------------------------------------------------------------------------
/Art/info/reject.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/info/reject.png
--------------------------------------------------------------------------------
/Art/screenshot/dribbble.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/screenshot/dribbble.png
--------------------------------------------------------------------------------
/Art/screenshot/overflow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/screenshot/overflow.png
--------------------------------------------------------------------------------
/Art/screenshot/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/screenshot/settings.png
--------------------------------------------------------------------------------
/Art/screenshot/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/screenshot/background.png
--------------------------------------------------------------------------------
/Art/screenshot/.directory:
--------------------------------------------------------------------------------
1 | [Dolphin]
2 | PreviewsShown=true
3 | Timestamp=2015,4,26,11,40,51
4 | Version=3
5 |
--------------------------------------------------------------------------------
/Art/screenshot/tab_switcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Art/screenshot/tab_switcher.png
--------------------------------------------------------------------------------
/Ninja/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mthli/Ninja/master/Ninja/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/Ninja/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
originalPosition to newPosition
19 | */
20 | void reorderItems(int originalPosition, int newPosition);
21 |
22 | /**
23 | * @return return columns number for GridView. Need for compatibility
24 | * (@link android.widget.GridView#getNumColumns() requires api 11)
25 | */
26 | int getColumnCount();
27 |
28 | /**
29 | * Determines whether the item in the specified position can be reordered.
30 | */
31 | boolean canReorder(int position);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/Ninja/src/io/github/mthli/Ninja/Fragment/ClearFragment.java:
--------------------------------------------------------------------------------
1 | package io.github.mthli.Ninja.Fragment;
2 |
3 | import android.content.SharedPreferences;
4 | import android.os.Bundle;
5 | import android.preference.PreferenceFragment;
6 | import io.github.mthli.Ninja.R;
7 |
8 | public class ClearFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
9 | @Override
10 | public void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | addPreferencesFromResource(R.xml.preference_clear);
13 | }
14 |
15 | @Override
16 | public void onResume() {
17 | super.onResume();
18 | SharedPreferences sp = getPreferenceScreen().getSharedPreferences();
19 | sp.registerOnSharedPreferenceChangeListener(this);
20 | }
21 |
22 | @Override
23 | public void onPause() {
24 | super.onPause();
25 | getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
26 | }
27 |
28 | @Override
29 | public void onSharedPreferenceChanged(SharedPreferences sp, String key) {}
30 | }
31 |
--------------------------------------------------------------------------------
/Ninja/res/layout/record_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | list from position indexFrom and insert it to indexTwo
15 | *
16 | * @param list
17 | * @param indexFrom
18 | * @param indexTwo
19 | */
20 | public static void reorder(List list, int indexFrom, int indexTwo) {
21 | Object obj = list.remove(indexFrom);
22 | list.add(indexTwo, obj);
23 | }
24 |
25 | /**
26 | * Swap item in list at position firstIndex with item at position secondIndex
27 | *
28 | * @param list The list in which to swap the items.
29 | * @param firstIndex The position of the first item in the list.
30 | * @param secondIndex The position of the second item in the list.
31 | */
32 | public static void swap(List list, int firstIndex, int secondIndex) {
33 | Object firstObject = list.get(firstIndex);
34 | Object secondObject = list.get(secondIndex);
35 | list.set(firstIndex, secondObject);
36 | list.set(secondIndex, firstObject);
37 | }
38 |
39 | public static float getViewX(View view) {
40 | return Math.abs((view.getRight() - view.getLeft()) / 2);
41 | }
42 |
43 | public static float getViewY(View view) {
44 | return Math.abs((view.getBottom() - view.getTop()) / 2);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/Ninja/res/layout/album.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |