diff --git a/app/src/debug/res/xml-v25/shortcuts.xml b/app/src/debug/res/xml-v25/shortcuts.xml new file mode 100644 index 000000000..557a49084 --- /dev/null +++ b/app/src/debug/res/xml-v25/shortcuts.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d7067dbd3..50ecb9fbc 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -48,6 +48,9 @@ + + @@ -144,6 +147,29 @@ android:theme="@style/AppTheme.NoActionBar" android:label="@string/hosts"/> + + + + + + + + + + + + diff --git a/app/src/main/java/com/hippo/ehviewer/shortcuts/StartAllDownloadActivity.java b/app/src/main/java/com/hippo/ehviewer/shortcuts/StartAllDownloadActivity.java new file mode 100644 index 000000000..6cec580a9 --- /dev/null +++ b/app/src/main/java/com/hippo/ehviewer/shortcuts/StartAllDownloadActivity.java @@ -0,0 +1,38 @@ +/* + * Copyright 2018 Hippo Seven + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hippo.ehviewer.shortcuts; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.hippo.ehviewer.download.DownloadService; + +/** + * Created by onlymash on 3/25/18. + */ + +public class StartAllDownloadActivity extends Activity{ + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + Intent intent = new Intent(this, DownloadService.class); + intent.setAction(DownloadService.ACTION_START_ALL); + startService(intent); + finish(); + } +} diff --git a/app/src/main/java/com/hippo/ehviewer/shortcuts/StopAllDownloadActivity.java b/app/src/main/java/com/hippo/ehviewer/shortcuts/StopAllDownloadActivity.java new file mode 100644 index 000000000..befb5c16e --- /dev/null +++ b/app/src/main/java/com/hippo/ehviewer/shortcuts/StopAllDownloadActivity.java @@ -0,0 +1,36 @@ +/* + * Copyright 2018 Hippo Seven + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hippo.ehviewer.shortcuts; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.hippo.ehviewer.download.DownloadService; + +/** + * Created by onlymash on 3/25/18. + */ + +public class StopAllDownloadActivity extends Activity { + + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + stopService(new Intent(this, DownloadService.class)); + finish(); + } +} diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_shortcut_start.xml b/app/src/main/res/mipmap-anydpi-v26/ic_shortcut_start.xml new file mode 100644 index 000000000..84f2dbd1b --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_shortcut_start.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_shortcut_stop.xml b/app/src/main/res/mipmap-anydpi-v26/ic_shortcut_stop.xml new file mode 100644 index 000000000..fcbed2bb6 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_shortcut_stop.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_shortcut_start_foreground.png b/app/src/main/res/mipmap-hdpi/ic_shortcut_start_foreground.png new file mode 100644 index 000000000..cad62f37d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_shortcut_start_foreground.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_shortcut_stop_foreground.png b/app/src/main/res/mipmap-hdpi/ic_shortcut_stop_foreground.png new file mode 100644 index 000000000..0b6aab692 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_shortcut_stop_foreground.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_shortcut_start_foreground.png b/app/src/main/res/mipmap-mdpi/ic_shortcut_start_foreground.png new file mode 100644 index 000000000..84c074de9 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_shortcut_start_foreground.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_shortcut_stop_foreground.png b/app/src/main/res/mipmap-mdpi/ic_shortcut_stop_foreground.png new file mode 100644 index 000000000..92b3e5f3b Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_shortcut_stop_foreground.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_shortcut_start_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_shortcut_start_foreground.png new file mode 100644 index 000000000..275363af4 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_shortcut_start_foreground.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_shortcut_stop_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_shortcut_stop_foreground.png new file mode 100644 index 000000000..12b6ad789 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_shortcut_stop_foreground.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_shortcut_start_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_shortcut_start_foreground.png new file mode 100644 index 000000000..57529d913 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_shortcut_start_foreground.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_shortcut_stop_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_shortcut_stop_foreground.png new file mode 100644 index 000000000..8af287e5a Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_shortcut_stop_foreground.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_shortcut_start_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_shortcut_start_foreground.png new file mode 100644 index 000000000..1fb4f7473 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_shortcut_start_foreground.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_shortcut_stop_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_shortcut_stop_foreground.png new file mode 100644 index 000000000..1a5ce20c0 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_shortcut_stop_foreground.png differ diff --git a/app/src/main/res/values/ic_shortcut_background.xml b/app/src/main/res/values/ic_shortcut_background.xml new file mode 100644 index 000000000..d533a7125 --- /dev/null +++ b/app/src/main/res/values/ic_shortcut_background.xml @@ -0,0 +1,4 @@ + + + #F5F5F5 + \ No newline at end of file diff --git a/app/src/main/res/xml-v25/shortcuts.xml b/app/src/main/res/xml-v25/shortcuts.xml new file mode 100644 index 000000000..35ebc94df --- /dev/null +++ b/app/src/main/res/xml-v25/shortcuts.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + +