/captures
/app/build
output.json
+/app/src/main/res/raw/third_party_license_metadata
+/app/src/main/res/raw/third_party_licenses
Taskbar is also included as part of the following Android distributions for PCs:
-* Android-x86 (version 7.1-rc2) (http://www.android-x86.org)
+* Android-x86 (7.1-rc2 and 7.1-r1) (http://www.android-x86.org)
* Bliss OS (x86 builds) (https://blissroms.com)
## How to Build
}
apply plugin: 'com.android.application'
+apply plugin: 'com.google.gms.oss.licenses.plugin'
repositories {
google()
minSdkVersion 21
targetSdkVersion SDK_VERSION
- versionCode 177
- versionName "3.8.1"
+ versionCode 178
+ versionName "3.8.2"
resConfigs "en", "ja", "ru", "de", "zh-rCN"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:design:${SUPPORT_LIBRARY_VERSION}"
- implementation 'com.mikepenz:iconics-core:3.0.0@aar'
+ implementation 'com.google.android.gms:play-services-oss-licenses:11.8.0'
+ implementation 'com.mikepenz:iconics-core:3.0.3@aar'
implementation 'com.mikepenz:foundation-icons-typeface:3.0.0.3@aar'
implementation 'moe.banana:toast-compat:1.0.5'
}
* HomeActivity is enabled by default
* SendSettingsReceiver and ReceiveSettingsReceiver are not exposed
-->
-<manifest android:versionCode="177"
- android:versionName="3.8.1"
+<manifest android:versionCode="178"
+ android:versionName="3.8.2"
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.farmerbb.taskbar" >
<activity
android:name=".activity.dark.NavigationBarButtonsActivityDark"
android:theme="@style/AppTheme.Dialog.Preference.Dark"/>
+ <activity
+ android:name=".activity.AboutDialogActivity"
+ android:theme="@style/AppTheme.Dialog.Preference"/>
+ <activity
+ android:name=".activity.dark.AboutDialogActivityDark"
+ android:theme="@style/AppTheme.Dialog.Preference.Dark"/>
<service android:name=".service.TaskbarService"/>
<service android:name=".service.StartMenuService"/>
static ToastInterface createToast(Context context, String message, int length) {
return new ToastFrameworkImpl(context, message, length);
}
+
+ public static void showLicenses(Context context) {}
}
--- /dev/null
+/* Copyright 2018 Braden Farmer
+ *
+ * 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.farmerbb.taskbar.activity;
+
+import android.content.ActivityNotFoundException;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+
+import com.farmerbb.taskbar.BuildConfig;
+import com.farmerbb.taskbar.R;
+import com.farmerbb.taskbar.util.DependencyUtils;
+import com.farmerbb.taskbar.util.U;
+
+public class AboutDialogActivity extends PreferenceActivity implements Preference.OnPreferenceClickListener {
+
+ @SuppressWarnings("deprecation")
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+ setTitle(R.string.pref_header_about);
+
+ if(!BuildConfig.APPLICATION_ID.equals(BuildConfig.ANDROIDX86_APPLICATION_ID)) {
+ addPreferencesFromResource(R.xml.pref_about_dialog);
+
+ findPreference("view_play_store").setOnPreferenceClickListener(this);
+ findPreference("view_licenses").setOnPreferenceClickListener(this);
+ } else
+ addPreferencesFromResource(R.xml.pref_about_dialog_alt);
+
+ findPreference("view_github").setOnPreferenceClickListener(this);
+ }
+
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ switch(preference.getKey()) {
+ case "view_play_store":
+ U.checkForUpdates(this);
+ break;
+ case "view_github":
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setData(Uri.parse("https://github.com/farmerbb/Taskbar"));
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ try {
+ startActivity(intent);
+ } catch (ActivityNotFoundException e) { /* Gracefully fail */ }
+ break;
+ case "view_licenses":
+ DependencyUtils.showLicenses(this);
+ break;
+ }
+
+ finish();
+ return true;
+ }
+}
\ No newline at end of file
--- /dev/null
+/* Copyright 2018 Braden Farmer
+ *
+ * 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.farmerbb.taskbar.activity.dark;
+
+import com.farmerbb.taskbar.activity.AboutDialogActivity;
+
+public class AboutDialogActivityDark extends AboutDialogActivity {}
import com.farmerbb.taskbar.BuildConfig;
import com.farmerbb.taskbar.R;
+import com.farmerbb.taskbar.activity.AboutDialogActivity;
+import com.farmerbb.taskbar.activity.dark.AboutDialogActivityDark;
import com.farmerbb.taskbar.util.U;
import java.text.NumberFormat;
switch(p.getKey()) {
case "about":
- U.checkForUpdates(getActivity());
+ Intent intent = null;
+
+ switch(pref.getString("theme", "light")) {
+ case "light":
+ intent = new Intent(getActivity(), AboutDialogActivity.class);
+ break;
+ case "dark":
+ intent = new Intent(getActivity(), AboutDialogActivityDark.class);
+ break;
+ }
+
+ startActivity(intent);
break;
case "donate":
NumberFormat format = NumberFormat.getCurrencyInstance();
builder.setTitle(R.string.pref_title_donate)
.setMessage(getString(R.string.dialog_donate_message, format.format(1.99)))
.setPositiveButton(R.string.action_ok, (dialog, which) -> {
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + BuildConfig.PAID_APPLICATION_ID));
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ Intent intent2 = new Intent(Intent.ACTION_VIEW);
+ intent2.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + BuildConfig.PAID_APPLICATION_ID));
+ intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
- startActivity(intent);
+ startActivity(intent2);
} catch (ActivityNotFoundException e) { /* Gracefully fail */ }
})
.setNegativeButton(noThanksCount == 2 ? R.string.action_dont_show_again : R.string.action_no_thanks, (dialog, which) -> {
if(!successfullyUpdated)
U.showToast(getActivity(), R.string.invalid_grid_size);
})
- .setNegativeButton(R.string.action_cancel, null);
+ .setNegativeButton(R.string.action_cancel, null)
+ .setNeutralButton(R.string.use_default, (dialog, id) -> {
+ pref.edit().remove("dashboard_width").remove("dashboard_height").apply();
+ updateDashboardGridSize(true);
+ });
editText.setText(Integer.toString(pref.getInt("dashboard_width", getActivity().getApplicationContext().getResources().getInteger(R.integer.dashboard_width))));
editText2.setText(Integer.toString(pref.getInt("dashboard_height", getActivity().getApplicationContext().getResources().getInteger(R.integer.dashboard_height))));
AlertDialog dialog = builder.create();
dialog.show();
dialog.setCancelable(false);
+ } else if(U.isUntestedAndroidVersion(getActivity())
+ && pref.getInt("current_api_version", Build.VERSION.SDK_INT - 1) < Build.VERSION.SDK_INT) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ builder.setTitle(R.string.samsung_freeform_title)
+ .setMessage(R.string.dialog_upgrade_message)
+ .setPositiveButton(R.string.action_ok, (dialog, which) -> pref.edit().putInt("current_api_version", Build.VERSION.SDK_INT).apply());
+
+ AlertDialog dialog = builder.create();
+ dialog.show();
+ dialog.setCancelable(false);
}
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(checkBoxReceiver, new IntentFilter("com.farmerbb.taskbar.UPDATE_FREEFORM_CHECKBOX"));
searchInterval = System.currentTimeMillis() - AlarmManager.INTERVAL_DAY;
break;
case "app_start":
- long oneDayAgo = System.currentTimeMillis() - AlarmManager.INTERVAL_DAY;
long appStartTime = pref.getLong("time_of_service_start", System.currentTimeMillis());
long deviceStartTime = System.currentTimeMillis() - SystemClock.elapsedRealtime();
- long startTime = deviceStartTime > appStartTime ? deviceStartTime : appStartTime;
- searchInterval = startTime > oneDayAgo ? startTime : oneDayAgo;
+ searchInterval = deviceStartTime > appStartTime ? deviceStartTime : appStartTime;
+ break;
+ case "show_all":
+ searchInterval = 0;
break;
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
private List<AppEntry> getAppEntriesUsingUsageStats() {
UsageStatsManager mUsageStatsManager = (UsageStatsManager) getSystemService(USAGE_STATS_SERVICE);
- List<UsageStats> usageStatsList = mUsageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_YEARLY, searchInterval, System.currentTimeMillis());
+ List<UsageStats> usageStatsList = mUsageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_BEST, searchInterval, System.currentTimeMillis());
List<AppEntry> entries = new ArrayList<>();
for(UsageStats usageStats : usageStatsList) {
}
private boolean isScreenOff() {
+ if(U.isChromeOs(this))
+ return false;
+
PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
return !pm.isInteractive();
}
}
public static void checkForUpdates(Context context) {
- if(!BuildConfig.APPLICATION_ID.equals(BuildConfig.ANDROIDX86_APPLICATION_ID)) {
- if(!BuildConfig.DEBUG) {
- String url;
- try {
- context.getPackageManager().getPackageInfo("com.android.vending", 0);
- url = "https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID;
- } catch (PackageManager.NameNotFoundException e) {
- url = "https://f-droid.org/repository/browse/?fdid=" + BuildConfig.BASE_APPLICATION_ID;
- }
+ if(!BuildConfig.DEBUG) {
+ String url;
+ try {
+ context.getPackageManager().getPackageInfo("com.android.vending", 0);
+ url = "https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID;
+ } catch (PackageManager.NameNotFoundException e) {
+ url = "https://f-droid.org/repository/browse/?fdid=" + BuildConfig.BASE_APPLICATION_ID;
+ }
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.setData(Uri.parse(url));
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setData(Uri.parse(url));
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- try {
- context.startActivity(intent);
- } catch (ActivityNotFoundException e) { /* Gracefully fail */ }
- } else
- showToast(context, R.string.debug_build);
- }
+ try {
+ context.startActivity(intent);
+ } catch (ActivityNotFoundException e) { /* Gracefully fail */ }
+ } else
+ showToast(context, R.string.debug_build);
}
public static boolean launcherIsDefault(Context context) {
public static void initPrefs(Context context) {
// On smaller-screened devices, set "Grid" as the default start menu layout
SharedPreferences pref = getSharedPreferences(context);
- if(context.getApplicationContext().getResources().getConfiguration().smallestScreenWidthDp < 600
+ if(context.getApplicationContext().getResources().getConfiguration().smallestScreenWidthDp < 720
&& pref.getString("start_menu_layout", "null").equals("null")) {
pref.edit().putString("start_menu_layout", "grid").apply();
}
editor.putString("sort_order", "true");
editor.putBoolean("full_length", true);
editor.putBoolean("dashboard", true);
- editor.putBoolean("scrollbar", true);
editor.putBoolean("app_drawer_icon", true);
editor.putBoolean("button_back", true);
editor.putBoolean("button_home", true);
.putString("sort_order", "true")
.putBoolean("full_length", true)
.putBoolean("dashboard", true)
- .putBoolean("scrollbar", true)
.putBoolean("android_x86_prefs", true)
.apply();
}
return false;
}
}
+
+ public static boolean isUntestedAndroidVersion(Context context) {
+ int androidSdkInt = Build.VERSION.SDK_INT;
+ int targetSdkInt = context.getApplicationInfo().targetSdkVersion;
+
+ if(androidSdkInt > targetSdkInt)
+ return true;
+
+ if(androidSdkInt >= Build.VERSION_CODES.M) {
+ int previewSdkInt = Build.VERSION.PREVIEW_SDK_INT;
+
+ return androidSdkInt == targetSdkInt && previewSdkInt > 0;
+ }
+
+ return false;
+ }
}
<string-array name="pref_recents_amount">
<item>Seit dem letzten Tag</item>
<item>Nach dem Start von Taskbar</item>
+ <item>All apps (may reduce performance)</item>
</string-array>
<string-array name="pref_recents_amount_alt">
<item>Seit dem letzten Tag</item>
<item>Nach dem Start von Taskbar</item>
+ <item>All apps (may reduce performance)</item>
<item>Running apps only</item>
</string-array>
<string name="pref_secondscreen_title_install">Install SecondScreen</string>
<string name="pref_secondscreen_description">Change your device\'s resolution and density when connected to an external display, for a Continuum or DeX-like experience</string>
+ <string name="dialog_upgrade_message">Taskbar\'s freeform mode support has not been tested on this version of Android. It may behave in unexpected ways - check for updates if there are any issues.</string>
+
+ <string name="use_default">Use default</string>
+
+ <string name="view_play_store">Check for updates</string>
+ <string name="view_github">View GitHub page</string>
+ <string name="view_licenses">Open source licenses</string>
+
</resources>
<string-array name="pref_recents_amount">
<item>経過日内</item>
<item>Taskbar 開始後</item>
+ <item>All apps (may reduce performance)</item>
</string-array>
<string-array name="pref_recents_amount_alt">
<item>経過日内</item>
<item>Taskbar 開始後</item>
+ <item>All apps (may reduce performance)</item>
<item>Running apps only</item>
</string-array>
<string name="pref_secondscreen_title_install">Install SecondScreen</string>
<string name="pref_secondscreen_description">Change your device\'s resolution and density when connected to an external display, for a Continuum or DeX-like experience</string>
+ <string name="dialog_upgrade_message">Taskbar\'s freeform mode support has not been tested on this version of Android. It may behave in unexpected ways - check for updates if there are any issues.</string>
+
+ <string name="use_default">Use default</string>
+
+ <string name="view_play_store">Check for updates</string>
+ <string name="view_github">View GitHub page</string>
+ <string name="view_licenses">Open source licenses</string>
+
</resources>
<string-array name="pref_recents_amount">
<item>В течение дня</item>
<item>После запуска Taskbar</item>
+ <item>All apps (may reduce performance)</item>
</string-array>
<string-array name="pref_recents_amount_alt">
<item>В течение дня</item>
<item>После запуска Taskbar</item>
+ <item>All apps (may reduce performance)</item>
<item>Running apps only</item>
</string-array>
<string name="pref_secondscreen_title_install">Install SecondScreen</string>
<string name="pref_secondscreen_description">Change your device\'s resolution and density when connected to an external display, for a Continuum or DeX-like experience</string>
+ <string name="dialog_upgrade_message">Taskbar\'s freeform mode support has not been tested on this version of Android. It may behave in unexpected ways - check for updates if there are any issues.</string>
+
+ <string name="use_default">Use default</string>
+
+ <string name="view_play_store">Check for updates</string>
+ <string name="view_github">View GitHub page</string>
+ <string name="view_licenses">Open source licenses</string>
+
</resources>
<resources>
<dimen name="max_width">720dp</dimen>
+ <dimen name="phone_size_width">411dp</dimen>
+ <dimen name="phone_size_height">731dp</dimen>
</resources>
<string-array name="pref_recents_amount">
<item>过去一天内</item>
<item>启动任务栏后</item>
+ <item>All apps (may reduce performance)</item>
</string-array>
<string-array name="pref_recents_amount_alt">
<item>过去一天内</item>
<item>启动任务栏后</item>
+ <item>All apps (may reduce performance)</item>
<item>仅限运行中的应用</item>
</string-array>
<string name="pref_secondscreen_title_install">Install SecondScreen</string>
<string name="pref_secondscreen_description">Change your device\'s resolution and density when connected to an external display, for a Continuum or DeX-like experience</string>
+ <string name="dialog_upgrade_message">Taskbar\'s freeform mode support has not been tested on this version of Android. It may behave in unexpected ways - check for updates if there are any issues.</string>
+
+ <string name="use_default">Use default</string>
+
+ <string name="view_play_store">Check for updates</string>
+ <string name="view_github">View GitHub page</string>
+ <string name="view_licenses">Open source licenses</string>
+
</resources>
\ No newline at end of file
<string-array name="pref_recents_amount_values">
<item>past_day</item>
<item>app_start</item>
+ <item>show_all</item>
</string-array>
<string-array name="pref_recents_amount_values_alt">
<item>past_day</item>
<item>app_start</item>
+ <item>show_all</item>
<item>running_apps_only</item>
</string-array>
<string name="pref_title_enable_recents">Enable/disable usage access</string>
<string name="pref_title_recents_refresh_interval">Refresh rate</string>
- <string name="pref_title_amount_of_recents">Display apps launched</string>
+ <string name="pref_title_amount_of_recents">Recent apps to display</string>
<string-array name="pref_recents_amount">
- <item>Within the past day</item>
- <item>After Taskbar start</item>
+ <item>Apps used within the past day</item>
+ <item>Apps used after Taskbar start</item>
+ <item>All apps (may reduce performance)</item>
</string-array>
<string-array name="pref_recents_amount_alt">
- <item>Within the past day</item>
- <item>After Taskbar start</item>
+ <item>Apps used within the past day</item>
+ <item>Apps used after Taskbar start</item>
+ <item>All apps (may reduce performance)</item>
<item>Running apps only</item>
</string-array>
<string name="pref_secondscreen_title_install">Install SecondScreen</string>
<string name="pref_secondscreen_description">Change your device\'s resolution and density when connected to an external display, for a Continuum or DeX-like experience</string>
+ <string name="dialog_upgrade_message">Taskbar\'s freeform mode support has not been tested on this version of Android. It may behave in unexpected ways - check for updates if there are any issues.</string>
+
+ <string name="use_default">Use default</string>
+
+ <string name="view_play_store">Check for updates</string>
+ <string name="view_github">View GitHub page</string>
+ <string name="view_licenses">Open source licenses</string>
+
</resources>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2018 Braden Farmer
+
+ 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <Preference
+ android:key="view_play_store"
+ android:title="@string/view_play_store" />
+
+ <Preference
+ android:key="view_github"
+ android:title="@string/view_github" />
+
+ <Preference
+ android:key="view_licenses"
+ android:title="@string/view_licenses" />
+
+</PreferenceScreen>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2018 Braden Farmer
+
+ 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <Preference
+ android:key="view_github"
+ android:title="@string/view_github" />
+
+</PreferenceScreen>
<activity
android:name=".activity.dark.NavigationBarButtonsActivityDark"
android:theme="@style/AppTheme.Dialog.Preference.Dark"/>
+ <activity
+ android:name=".activity.AboutDialogActivity"
+ android:theme="@style/AppTheme.Dialog.Preference"/>
+ <activity
+ android:name=".activity.dark.AboutDialogActivityDark"
+ android:theme="@style/AppTheme.Dialog.Preference.Dark"/>
<service android:name=".service.TaskbarService"/>
<service android:name=".service.StartMenuService"/>
package com.farmerbb.taskbar.util;
import android.content.Context;
+import android.content.Intent;
import android.os.Build;
import com.farmerbb.taskbar.R;
+import com.google.android.gms.oss.licenses.OssLicensesMenuActivity;
import com.mikepenz.iconics.Iconics;
public class DependencyUtils {
else
return new ToastCompatImpl(context, message, length);
}
+
+ public static void showLicenses(Context context) {
+ Intent intent = new Intent(context, OssLicensesMenuActivity.class);
+ context.startActivity(intent);
+ }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath 'com.google.gms:oss-licenses:0.9.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip