Rebase to master when repo went private

This commit is contained in:
Your Name
2020-08-17 13:31:05 +01:00
commit fe20b27432
345 changed files with 28876 additions and 0 deletions
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sidequest.launcher" >
<!-- Permissions -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/AppName"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true" >
<!-- Main Activity (Launcher Activity) -->
<activity
android:name="com.sidequest.launcher.gui.MainActivity"
android:label="@string/AppName"
android:launchMode="singleInstance"
android:stateNotNeeded="true"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
</intent-filter>
<!-- Use intent-filters of amazon-launcher instead
<intent-filter android:priority="1950">
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
<intent-filter android:priority="1900">
<action android:name="android.intent.action.VIEW"/>
<category android:name="com.amazon.device.intent.category.LAUNCHER_MENU"/>
</intent-filter>
-->
</activity>
</application>
</manifest>
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

@@ -0,0 +1,330 @@
package com.sidequest.launcher.gui;
import android.app.AlertDialog;
import android.app.FragmentManager;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.Toast;
import java.io.PrintWriter;
import java.io.StringWriter;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.AppInfo;
import com.sidequest.launcher.tools.AppStarter;
import com.sidequest.launcher.tools.AppStarterUpdater;
import com.sidequest.launcher.tools.SettingsProvider;
import com.sidequest.launcher.tools.Tools;
import static com.sidequest.launcher.gui.AppSettingsOverlayDialog.*;
/**
* Launcher main (shows the user apps)
*/
public class AppActivity extends CustomFragment
{
/**
* Default launcher package
*/
private String mDefaultLauncherPackage;
// Moving app-info (if null, no app is moving
private final AppInfo[] mMovingApp = {null};
/**
* Instance of settingsprovider
*/
SettingsProvider mSettings = SettingsProvider.getInstance(this.getActivity());
/** Latest AppStarter version found */
public static String LATEST_APP_VERSION = null;
/**
* Holds the gridview resource
*/
private GridView mGridView;
/**
* Indicated if app has been in pause but was not destroyed
*/
private Boolean mHasBeenInOnPauseButNotInDestroy = false;
/** Mandatory for fragment initation */
public AppActivity(){ }
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View rootView = inflater.inflate(R.layout.appactivity, container, false);
// Reset pause flag
mHasBeenInOnPauseButNotInDestroy = false;
// Get default-launcher package
mDefaultLauncherPackage = AppStarter.getLauncherPackageName(getActivity());
// Check for custom app-icon size
mGridView = (GridView) rootView.findViewById(R.id.gridview);
Integer appIconSize = mSettings.getAppIconSize();
if(appIconSize > 0)
{
// Set size of items
mGridView.setColumnWidth(Tools.getPixelFromDip(getActivity(), appIconSize));
}
mGridView.setAdapter(new InstalledAppsAdapter(getActivity()));
// Focus first item
mGridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
{
@Override
public void onGlobalLayout()
{
try
{
// Remove listener
mGridView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
// Check if first icon have to be selected
if(mSettings.getAutoSelectFirstIcon() && mGridView.getChildCount() > 0)
{
mGridView.requestFocusFromTouch();
mGridView.setSelection(0);
}
// Check for new update
AppStarterUpdater appStarterUpdater = new AppStarterUpdater();
if(!mSettings.getHaveUpdateSeen() && appStarterUpdater.isVersionNewer(Tools.getCurrentAppVersion(getActivity()), LATEST_APP_VERSION))
{
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("AppStarter " + LATEST_APP_VERSION);
builder.setMessage("There is a new version of AppStarter, do you want to update?");
builder.setPositiveButton("YES", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
dialog.dismiss();
// Trigger update
if(getActivity() instanceof MainActivity)
{
((MainActivity) getActivity()).triggerUpdate();
}
}
});
builder.setNegativeButton("NO", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
// Set have seen
mSettings.setHaveUpdateSeen(true);
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
}
catch (Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(MainActivity.class.getName(), "Failed to focus first app: \n" + errorReason);
}
}
});
// Set click listener
mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View v, int position, long id)
{
if (mMovingApp[0] != null)
{
// Stop moving
mMovingApp[0] = null;
mGridView.setDrawSelectorOnTop(false);
mGridView.invalidate();
// Save current order
InstalledAppsAdapter actAdapter = (InstalledAppsAdapter) parent.getAdapter();
actAdapter.storeNewPackageOrder();
} else
{
// Get packagename of the app to be started
String packageName = ((AppInfo) parent.getAdapter().getItem(position)).packageName;
// Now start app
AppStarter.startAppByPackageName(getActivity(), packageName, false, false, false);
}
}
});
// Set long click listener
mGridView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener()
{
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id)
{
// Get packagename of the app to be started
mMovingApp[0] = (AppInfo) parent.getAdapter().getItem(position);
mGridView.setDrawSelectorOnTop(true);
mGridView.invalidate();
Toast.makeText(getActivity(), getActivity().getResources().getString(R.string.MoveAppAndClickToDrop), Toast.LENGTH_SHORT).show();
return true;
}
});
// Set select listener
mGridView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
{
if (mMovingApp[0] != null)
{
InstalledAppsAdapter actAdapter = (InstalledAppsAdapter) parent.getAdapter();
actAdapter.moveAppToPosition(mMovingApp[0], position);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent)
{
// Do nothing here
}
});
return rootView;
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
@Override
public void onPause()
{
super.onPause();
mHasBeenInOnPauseButNotInDestroy = true;
}
@Override
public void onResume()
{
super.onResume();
if (mHasBeenInOnPauseButNotInDestroy)
{
// Reload app order
Log.d(MainActivity.class.getName(), "Reloading Order.");
InstalledAppsAdapter actAdapter = (InstalledAppsAdapter) mGridView.getAdapter();
actAdapter.loadInstalledApps();
actAdapter.notifyDataSetChanged();
}
}
@Override
public boolean onBackPressed()
{
boolean retVal = false;
if(mMovingApp[0] != null)
{
// Stop moving without saving the order
mMovingApp[0] = null;
mGridView.setDrawSelectorOnTop(false);
mGridView.invalidate();
// Restore old order
InstalledAppsAdapter actAdapter = (InstalledAppsAdapter)mGridView.getAdapter();
actAdapter.loadInstalledApps();
actAdapter.notifyDataSetChanged();
retVal = true;
}
return retVal;
}
@Override
public boolean onKeyDown(int keycode, KeyEvent e)
{
if(mMovingApp[0] == null && keycode == KeyEvent.KEYCODE_MENU)
{
showAppSettingsDialogForCurrentApp();
return true;
}
return false;
}
private void showAppSettingsDialogForCurrentApp()
{
try
{
// Check selected app
if(mGridView.hasFocus())
{
final AppInfo appInfo = (AppInfo) ((InstalledAppsAdapter) mGridView.getAdapter()).getItem(mGridView.getSelectedItemPosition());
final AppSettingsOverlayDialog appSettingsDialog = newInstance(appInfo);
appSettingsDialog.setOnActionClickedHandler(new OnActionClickedHandler()
{
@Override
public void onActionClicked(ActionEnum action)
{
Log.d("AppSettingsAction", "Clicked action: " + action.toString());
// Close dialog and evaluate click event:
appSettingsDialog.dismiss();
switch (action)
{
case SORT:
// Get packagename of the app to be started
mMovingApp[0] = appInfo;
mGridView.setDrawSelectorOnTop(true);
mGridView.invalidate();
Toast.makeText(getActivity(), getActivity().getResources().getString(R.string.MoveAppAndClickToDropWhenStartedByMenu), Toast.LENGTH_SHORT).show();
break;
case SETTINGS:
AppStarter.startSettingsViewByPackageName(AppActivity.this.getActivity(), appInfo.packageName);
break;
default:
// Do nothing by default
}
}
});
FragmentManager fm = getActivity().getFragmentManager();
appSettingsDialog.show(fm, "");
}
}
catch (Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(MainActivity.class.getName(), "Failed to load app settings: \n" + errorReason);
}
}
}
@@ -0,0 +1,125 @@
package com.sidequest.launcher.gui;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.AppInfo;
/**
* App Settings Overlay for additional settings per app
*/
public class AppSettingsOverlayDialog extends DialogFragment
{
public enum ActionEnum { NOTHING, SORT, SETTINGS }
public static AppSettingsOverlayDialog newInstance(AppInfo appInfo)
{
// Create dialog and set custom style
AppSettingsOverlayDialog dialog = new AppSettingsOverlayDialog();
dialog.setStyle(DialogFragment.STYLE_NO_FRAME, R.style.TransparentDialog);
// Add needed stuff
dialog.setAppInfo(appInfo);
return dialog;
}
/** AppInfo of the current App */
private AppInfo mAppInfo;
/** Action handler */
private OnActionClickedHandler onActionClickedHandler;
/**
* Default constructor required for DialogFragment
*/
public AppSettingsOverlayDialog()
{
}
/**
* Set the action click listener
* @param listener
*/
public void setOnActionClickedHandler(OnActionClickedHandler listener)
{
onActionClickedHandler = listener;
}
/**
* Sets the current AppInfo
* @param appInfo
*/
public void setAppInfo(AppInfo appInfo)
{
mAppInfo = appInfo;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
final Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
return dialog;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// Create view
View view = inflater.inflate(R.layout.appsettingsoverlaydialog, container);
// Set text, icons and click-handler
TextView title = (TextView) view.findViewById(R.id.title);
title.setText(mAppInfo.getDisplayName());
ImageView appIcon = (ImageView) view.findViewById(R.id.appIcon);
appIcon.setImageDrawable(mAppInfo.getDisplayIcon());
LinearLayout appSort = (LinearLayout) view.findViewById(R.id.appSort);
appSort.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
fireActionClicked(ActionEnum.SORT);
}
});
LinearLayout appSettings = (LinearLayout) view.findViewById(R.id.appSettings);
appSettings.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
fireActionClicked(ActionEnum.SETTINGS);
}
});
return view;
}
private void fireActionClicked(ActionEnum action)
{
if(onActionClickedHandler != null)
{
onActionClickedHandler.onActionClicked(action);
}
}
/**
* Interface for a service error
*/
public interface OnActionClickedHandler
{
public void onActionClicked(ActionEnum action);
}
}
@@ -0,0 +1,23 @@
package com.sidequest.launcher.gui;
import android.app.Fragment;
import android.view.KeyEvent;
/**
* Fragement that has additional features
*/
public class CustomFragment extends Fragment
{
/**
* Custom on backpressed method
*/
public boolean onBackPressed()
{
return false;
}
public boolean onKeyDown(int keycode, KeyEvent e)
{
return false;
}
}
@@ -0,0 +1,246 @@
package com.sidequest.launcher.gui;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Environment;
import android.util.Log;
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Created by luki on 27.06.15.
*/
public class FileDialog
{
private static final String PARENT_DIR = "..";
private final String TAG = getClass().getName();
private String[] fileList;
private File currentPath;
public interface FileSelectedListener
{
void fileSelected(File file);
}
public interface DirectorySelectedListener
{
void directorySelected(File directory);
}
private ListenerList<FileSelectedListener> fileListenerList = new ListenerList<FileDialog.FileSelectedListener>();
private ListenerList<DirectorySelectedListener> dirListenerList = new ListenerList<FileDialog.DirectorySelectedListener>();
private final Activity activity;
private boolean selectDirectoryOption;
private String[] fileEndsWith;
/**
* @param activity
* @param path
*/
public FileDialog(Activity activity, File path)
{
this.activity = activity;
if (!path.exists()) path = Environment.getExternalStorageDirectory();
loadFileList(path);
}
/**
* @return file dialog
*/
public Dialog createFileDialog()
{
Dialog dialog = null;
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(currentPath.getPath());
if (selectDirectoryOption)
{
builder.setPositiveButton("Select directory", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
Log.d(TAG, currentPath.getPath());
fireDirectorySelectedEvent(currentPath);
}
});
}
builder.setItems(fileList, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
String fileChosen = fileList[which];
File chosenFile = getChosenFile(fileChosen);
if (chosenFile.isDirectory())
{
loadFileList(chosenFile);
dialog.cancel();
dialog.dismiss();
showDialog();
} else fireFileSelectedEvent(chosenFile);
}
});
dialog = builder.show();
return dialog;
}
public void addFileListener(FileSelectedListener listener)
{
fileListenerList.add(listener);
}
public void removeFileListener(FileSelectedListener listener)
{
fileListenerList.remove(listener);
}
public void setSelectDirectoryOption(boolean selectDirectoryOption)
{
this.selectDirectoryOption = selectDirectoryOption;
}
public void addDirectoryListener(DirectorySelectedListener listener)
{
dirListenerList.add(listener);
}
public void removeDirectoryListener(DirectorySelectedListener listener)
{
dirListenerList.remove(listener);
}
/**
* Show file dialog
*/
public void showDialog()
{
createFileDialog().show();
}
private void fireFileSelectedEvent(final File file)
{
fileListenerList.fireEvent(new ListenerList.FireHandler<FileSelectedListener>()
{
public void fireEvent(FileSelectedListener listener)
{
listener.fileSelected(file);
}
});
}
private void fireDirectorySelectedEvent(final File directory)
{
dirListenerList.fireEvent(new ListenerList.FireHandler<DirectorySelectedListener>()
{
public void fireEvent(DirectorySelectedListener listener)
{
listener.directorySelected(directory);
}
});
}
private void loadFileList(File path)
{
this.currentPath = path;
List<String> r = new ArrayList<String>();
if (path.exists())
{
if (path.getParentFile() != null) r.add(PARENT_DIR);
FilenameFilter filter = new FilenameFilter()
{
public boolean accept(File dir, String filename)
{
File sel = new File(dir, filename);
if (!sel.canRead()) return false;
if (selectDirectoryOption) return sel.isDirectory();
else
{
boolean endsWith = false;
if(fileEndsWith != null)
{
for (String ending : fileEndsWith)
{
if (filename.toLowerCase().endsWith(ending))
{
endsWith = true;
break;
}
}
}
return endsWith || sel.isDirectory();
}
}
};
String[] fileList1 = path.list(filter);
for (String file : fileList1)
{
r.add(file);
}
}
Collections.sort(r);
fileList = (String[]) r.toArray(new String[]{});
}
private File getChosenFile(String fileChosen)
{
if (fileChosen.equals(PARENT_DIR)) return currentPath.getParentFile();
else return new File(currentPath, fileChosen);
}
public void setFileEndsWith(String[] fileEndsWith)
{
if(fileEndsWith != null)
{
for(Integer i = 0; i < fileEndsWith.length; i++)
{
fileEndsWith[i] = fileEndsWith[i].toLowerCase();
}
}
this.fileEndsWith = fileEndsWith;
// Again load file-list (because now file-list can change)
loadFileList(currentPath);
}
}
class ListenerList<L>
{
private List<L> listenerList = new ArrayList<L>();
public interface FireHandler<L>
{
void fireEvent(L listener);
}
public void add(L listener)
{
listenerList.add(listener);
}
public void fireEvent(FireHandler<L> fireHandler)
{
List<L> copy = new ArrayList<L>(listenerList);
for (L l : copy)
{
fireHandler.fireEvent(l);
}
}
public void remove(L listener)
{
listenerList.remove(listener);
}
public List<L> getListenerList()
{
return listenerList;
}
}
@@ -0,0 +1,79 @@
package com.sidequest.launcher.gui;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.sidequest.launcher.R;
/**
* Info Overlay for additional information
*/
public class InfoOverlayDialog extends DialogFragment
{
/**
* Create a new Info-Overlay dialog
* @param title Title of the info dialog
* @param summary Text of the info dialog
* @return the dialog
*/
public static InfoOverlayDialog newInstance(String title, String summary)
{
// Create dialog and set custom style
InfoOverlayDialog dialog = new InfoOverlayDialog();
dialog.setStyle(DialogFragment.STYLE_NO_FRAME, R.style.TransparentDialog);
// Set title and summary
dialog.setTitleAndSummary(title, summary);
return dialog;
}
/** Title of the info dialog */
private String mTitle;
/** Text of the info dialog */
private String mSummary;
/**
* Default constructor required for DialogFragment
*/
public InfoOverlayDialog()
{
}
public void setTitleAndSummary(String title, String summary)
{
// Set title and summary
mTitle = title;
mSummary = summary;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
final Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
return dialog;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// Create view
View view = inflater.inflate(R.layout.infooverlaydialog, container);
// Set text, icons and click-handler
TextView title = (TextView) view.findViewById(R.id.title);
title.setText(mTitle);
TextView summary = (TextView) view.findViewById(R.id.summary);
summary.setText(mSummary);
return view;
}
}
@@ -0,0 +1,109 @@
package com.sidequest.launcher.gui;
import android.os.Bundle;
import android.os.SystemClock;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.widget.Toast;
import java.text.DateFormat;
import java.util.Date;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.Tools;
/**
* Info / System view
*/
public class InfosPrefActivity extends PreferenceFragment
{
static final long SLEEPTIME_MINIMUM = 1;
static final long SLEEPTIME_MAXIMUM = 120;
public InfosPrefActivity()
{
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.infoprefactivity);
Preference prefDeviceDetails = (Preference) findPreference("prefVirtualDeviceDetails");
prefDeviceDetails.setSummary(Tools.getDeviceDetails());
Preference prefHostname = (Preference) findPreference("prefVirtualHostname");
prefHostname.setSummary(Tools.getHostName(getActivity().getResources().getString(R.string.notfound)));
Preference prefWifiName = (Preference) findPreference("prefVirtualWifiName");
prefWifiName.setSummary(Tools.getWifiSsid(this.getActivity(), getActivity().getResources().getString(R.string.notfound)));
Preference prefIpAddress = (Preference) findPreference("prefVirtualIpAddress");
prefIpAddress.setSummary(Tools.getActiveIpAddress(getActivity(), getActivity().getResources().getString(R.string.notfound)));
Preference prefDeviceUpTime = (Preference) findPreference("prefVirtualDeviceUpTime");
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.MEDIUM, getResources().getConfiguration().locale);
String upTime = String.format(getActivity().getResources().getString(R.string.uptimedesc), Tools.formatInterval(SystemClock.elapsedRealtime()), dateFormat.format(new Date(System.currentTimeMillis() - SystemClock.elapsedRealtime())));
prefDeviceUpTime.setSummary(upTime);
// final EditTextPreference prefSetSleepTimeout = (EditTextPreference) findPreference("prefVirtualSleepTime");
// prefSetSleepTimeout.setText(((Long)(Tools.getSleepModeTimeout(getActivity()) / 1000 / 60)).toString());
// prefSetSleepTimeout.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
// {
// @Override
// public boolean onPreferenceChange(Preference preference, Object newValue)
// {
// long newTimeInMinutes = 0;
// try
// {
// newTimeInMinutes = Long.valueOf(newValue.toString());
// }
// catch (Exception ignore)
// {
// }
//
// do
// {
// if (newTimeInMinutes < SLEEPTIME_MINIMUM || newTimeInMinutes > SLEEPTIME_MAXIMUM)
// {
// Toast.makeText(InfosPrefActivity.this.getActivity(), String.format(getActivity().getResources().getString(R.string.sleeptime_limit), SLEEPTIME_MINIMUM, SLEEPTIME_MAXIMUM), Toast.LENGTH_SHORT).show();
// break;
// }
//
// long newTimeInMs = newTimeInMinutes * 60 * 1000;
// Tools.setSleepModeTimeout(getActivity(), newTimeInMs);
// prefSetSleepTimeout.setText(((Long)(Tools.getSleepModeTimeout(getActivity()) / 1000 / 60)).toString());
// }
// while (false);
//
// return false;
// }
// });
//
// Preference prefGoToSleep = (Preference) findPreference("prefVirtualGoToSleep");
// prefGoToSleep.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
// {
// @Override
// public boolean onPreferenceClick(Preference preference)
// {
// Toast.makeText(InfosPrefActivity.this.getActivity(), getActivity().getResources().getString(R.string.gotosleep_summary), Toast.LENGTH_SHORT).show();
// return false;
// }
// });
//
// Preference prefReboot = (Preference) findPreference("prefVirtualRestart");
// prefReboot.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
// {
// @Override
// public boolean onPreferenceClick(Preference preference)
// {
// Toast.makeText(InfosPrefActivity.this.getActivity(), getActivity().getResources().getString(R.string.system_restart_summary_removed), Toast.LENGTH_SHORT).show();
// return false;
// }
// });
}
}
@@ -0,0 +1,434 @@
package com.sidequest.launcher.gui;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.AppInfo;
import com.sidequest.launcher.tools.AppStarter;
import com.sidequest.launcher.tools.SettingsProvider;
import com.sidequest.launcher.tools.Tools;
/**
* Adapter that lists all installed apps
*/
public class InstalledAppsAdapter extends BaseAdapter
{
/** Virtual package for settings app */
public static final String VIRTUAL_SETTINGS_PACKAGE = "de.belu.appstarter.virtual.settings";
/** Context we are currently running in */
private Context mContext;
/** List of installed apps */
private List<AppInfo> mInstalledApps;
/** Default launcher package */
private String mDefaultLauncherPackage;
/** Settings */
private SettingsProvider mSettings;
/** Include this app */
private Boolean mIncludeOwnApp;
/** Show hidden apps */
private Boolean mShowHiddenApps;
/**
* Create new InstalledAppsAdapter
* @param c Current context
*/
public InstalledAppsAdapter(Context c)
{
this(c, false, false);
}
/**
* Create new InstalledAppsAdapter
* @param c Current context
* @param includeOwnApp Include this app (de.belu.appstarter)
*/
public InstalledAppsAdapter(Context c, Boolean includeOwnApp, Boolean showHiddenApps)
{
mContext = c;
mIncludeOwnApp = includeOwnApp;
mShowHiddenApps = showHiddenApps;
// Get default-launcher package
mDefaultLauncherPackage = AppStarter.getLauncherPackageName(mContext);
// Get instance of settingsprovider
mSettings = SettingsProvider.getInstance(mContext);
// Now load all installed apps
loadInstalledApps();
}
/**
* Create a launchable intent by package-name
* @param context Current context
* @param packageName Package name of app
* @return Launchable intent
*/
@SuppressLint("NewApi")
public static Intent getLaunchableIntentByPackageName(Context context, String packageName)
{
// Create intent
Intent launchIntent = null;
// Check if package is one of the virtual packages
if(packageName.equals(VIRTUAL_SETTINGS_PACKAGE))
{
launchIntent = new Intent(android.provider.Settings.ACTION_SETTINGS);
// Start settings as new activity
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
}
else
{
try
{
launchIntent = context.getPackageManager().getLeanbackLaunchIntentForPackage(packageName);
}
catch(Throwable ignore) { }
if(launchIntent == null)
{
launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
}
}
// Return the launchable intent
return launchIntent;
}
/**
* @return Count of installed apps
*/
public int getCount()
{
return mInstalledApps.size();
}
/**
* @param position Position of item to be returned
* @return Item on position
*/
public Object getItem(int position)
{
return mInstalledApps.get(position);
}
/**
* Currently not used..
*/
public long getItemId(int position)
{
return position;
}
/**
* @return List of found apps
*/
public List<AppInfo> getAppList()
{
return mInstalledApps;
}
/**
* Store current package-order in settings
*/
public void storeNewPackageOrder()
{
List<String> packageList = new ArrayList<String>();
for(AppInfo actApp : mInstalledApps)
{
packageList.add(actApp.packageName);
}
mSettings.setPackageOrder(packageList);
}
/**
* Move certain item to certain position
* @param app Item to move
* @param position Position to move to
*/
public void moveAppToPosition(AppInfo app, int position)
{
if(mInstalledApps.contains(app))
{
try
{
mInstalledApps.remove(app);
mInstalledApps.add(position, app);
notifyDataSetChanged();
}
catch(Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(InstalledAppsAdapter.class.getName(), "Error while moving app: \n" + errorReason);
}
}
}
/**
* @return View of the given position
*/
public View getView(int position, View convertView, ViewGroup parent)
{
// Get act app
AppInfo actApp = mInstalledApps.get(position);
// Inflate layout
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View gridView;
if (convertView == null)
{
gridView = new View(mContext);
// get layout depending on setting
if(mSettings.getShowBackgroundForAppNames())
{
gridView = inflater.inflate(R.layout.appdrawergriditemlayout_withbackground, parent, false);
}
else
{
gridView = inflater.inflate(R.layout.appdrawergriditemlayout, parent, false);
}
} else
{
gridView = (View) convertView;
}
Integer appIconSize = mSettings.getAppIconSize();
if(appIconSize > 0)
{
// Set size of items
appIconSize = Tools.getPixelFromDip(parent.getContext(), appIconSize);
LinearLayout linearLayout = (LinearLayout) gridView.findViewById(R.id.linearLayout);
ViewGroup.LayoutParams params = linearLayout.getLayoutParams();
params.width = appIconSize;
params.height = appIconSize;
linearLayout.setLayoutParams(params);
}
// set value into textview
TextView textView = (TextView) gridView.findViewById(R.id.textLabel);
textView.setText(actApp.getDisplayName());
// set image based on selected text
ImageView imageView = (ImageView) gridView.findViewById(R.id.imageLabel);
imageView.setImageDrawable(actApp.getDisplayIcon());
return gridView;
}
/**
* Load all installed apps and order them correctly
*/
public void loadInstalledApps()
{
// Get hashset of hidden apps
Set<String> hiddenApps;
if(mShowHiddenApps)
{
// Create empty hidden-list
hiddenApps = new HashSet<String>();
}
else
{
hiddenApps = mSettings.getHiddenApps();
}
// Get list of installed apps
PackageManager pm = mContext.getPackageManager();
List<ApplicationInfo> installedApplications = pm.getInstalledApplications(PackageManager.GET_META_DATA);
// Put them into a map with packagename as keyword for faster handling
Boolean includeSysApps = mSettings.getShowSystemApps();
String ownPackageName = mContext.getApplicationContext().getPackageName();
Map<String, ApplicationInfo> appMap = new LinkedHashMap<String, ApplicationInfo>();
for(ApplicationInfo installedApplication : installedApplications)
{
if(!hiddenApps.contains(installedApplication.packageName))
{
// Check for system app
Boolean isSystemApp = ((installedApplication.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1 ||
(installedApplication.flags & ApplicationInfo.FLAG_SYSTEM) == 1);
// If amazon-home, mark not as system app
if(isSystemApp && installedApplication.packageName.equals(mDefaultLauncherPackage))
{
isSystemApp = false;
}
if(includeSysApps || !isSystemApp)
{
if((mIncludeOwnApp || !installedApplication.packageName.equals(ownPackageName)))
{
appMap.put(installedApplication.packageName, installedApplication);
}
}
}
}
// Add virtual packages if not hided
if(!hiddenApps.contains(VIRTUAL_SETTINGS_PACKAGE))
{
// ApplicationInfo applicationInfo = new ApplicationInfo();
// applicationInfo.packageName = VIRTUAL_SETTINGS_PACKAGE;
// appMap.put(VIRTUAL_SETTINGS_PACKAGE, new AppInfo(mContext, applicationInfo)
// {
// @Override
// public String getDisplayName()
// {
// return mContext.getResources().getString(R.string.AmazonSettings);
// }
//
// @Override
// public Drawable getDisplayIcon()
// {
// Drawable retVal = null;
//
// try
// {
// retVal = new BitmapDrawable(mContext.getResources(), BitmapFactory.decodeStream(mContext.getAssets().open("firetv-settings-icon.png")));
// }
// catch (Exception ignore){ }
//
// return retVal;
// }
// });
}
// Get order of last run
List<String> packageOrder = mSettings.getPackageOrder();
// Create new list of apps
mInstalledApps = new ArrayList<AppInfo>();
// Default the amazon launcher to the first position
// (if user has moved it, it is not anymore in list here)
if(packageOrder.contains("com.sidequest.launcher"))
{
packageOrder.remove("com.sidequest.launcher");
}
if(packageOrder.contains("com.sidequest.wrapper"))
{
packageOrder.remove("com.sidequest.wrapper");
}
if(appMap.containsKey("com.sidequest.launcher"))
{
appMap.remove("com.sidequest.launcher");
}
if(appMap.containsKey("com.sidequest.wrapper"))
{
appMap.remove("com.sidequest.wrapper");
}
if(appMap.containsKey(mDefaultLauncherPackage))
{
//addAppToCurrentList(appMap.get(mDefaultLauncherPackage));
appMap.remove(mDefaultLauncherPackage);
}
// Default amazon settings to the second position
// (if user has moved it, it is not anymore in list here)
if(appMap.containsKey(VIRTUAL_SETTINGS_PACKAGE))
{
//addAppToCurrentList(appMap.get(VIRTUAL_SETTINGS_PACKAGE));
appMap.remove(VIRTUAL_SETTINGS_PACKAGE);
}
// First handle all apps of the last run
for(String packageName : packageOrder)
{
if(appMap.containsKey(packageName))
{
addAppToCurrentList(appMap.get(packageName));
appMap.remove(packageName);
}
}
// Now handle all other apps
for(ApplicationInfo installedApplication : appMap.values())
{
addAppToCurrentList(installedApplication);
}
}
/**
* @param app App to be added to current apps-list
*/
private void addAppToCurrentList(ApplicationInfo app)
{
if(app.packageName.equals(mDefaultLauncherPackage))
{
AppInfo amazonLauncher = new AppInfo(mContext, app)
{
@Override
public String getDisplayName()
{
return mContext.getResources().getString(R.string.AmazonHome);
}
@Override
public Drawable getDisplayIcon()
{
Drawable retVal = null;
try
{
retVal = new BitmapDrawable(mContext.getResources(), BitmapFactory.decodeStream(mContext.getAssets().open("firetv-home-icon.png")));
}
catch (Exception ignore){ }
return retVal;
}
};
mInstalledApps.add(amazonLauncher);
}
else
{
if(app instanceof AppInfo)
{
mInstalledApps.add((AppInfo)app);
}
else
{
mInstalledApps.add(new AppInfo(mContext, app));
}
}
}
}
@@ -0,0 +1,112 @@
package com.sidequest.launcher.gui;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import com.sidequest.launcher.R;
/**
* Adpater for items in the left selection bar
*/
public class LeftBarItemsListAdapter extends BaseAdapter
{
/**
* A left bar fragment item
*/
public static class FragmentListItem
{
public String description;
public String className;
public FragmentListItem(String description, String className)
{
this.description = description;
this.className = className;
}
@Override
public String toString()
{
return description;
}
}
/** Left bar item list */
private static List<FragmentListItem> mItems = null;
/** Current context */
private Context mContext;
/** Create new adapter */
public LeftBarItemsListAdapter(Context context)
{
mContext = context;
if(mItems == null)
{
mItems = new ArrayList<FragmentListItem>();
mItems.add(new FragmentListItem(mContext.getResources().getString(R.string.leftbar_allapps), AppActivity.class.getName()));
mItems.add(new FragmentListItem(mContext.getResources().getString(R.string.leftbar_infos), InfosPrefActivity.class.getName()));
// mItems.add(new FragmentListItem(mContext.getResources().getString(R.string.leftbar_updates), UpdaterActivity.class.getName()));
mItems.add(new FragmentListItem(mContext.getResources().getString(R.string.leftbar_settings), PreferenceActivity.class.getName()));
}
}
/**
* @return Count of installed apps
*/
public int getCount()
{
return mItems.size();
}
/**
* @param position Position of item to be returned
* @return Item on position
*/
public FragmentListItem getItem(int position)
{
return mItems.get(position);
}
/**
* Currently not used..
*/
public long getItemId(int position)
{
return position;
}
/**
* @return View of the given position
*/
public View getView(int position, View convertView, ViewGroup parent)
{
// Inflate layout
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View itemView;
if (convertView == null)
{
// get layout from mobile.xml
itemView = inflater.inflate(R.layout.leftbarlistitemlayout, parent, false);
} else
{
itemView = (View) convertView;
}
// set value into textview
TextView textView = (TextView) itemView.findViewById(R.id.textLabel);
textView.setText(mItems.get(position).description);
return itemView;
}
}
@@ -0,0 +1,458 @@
package com.sidequest.launcher.gui;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.SettingsProvider;
public class MainActivity extends Activity
{
private LinearLayout mMainLayout;
private LinearLayout mSemiTransparentLayout;
private ListView mListView;
private Fragment mLastSetFragment;
private SettingsProvider mSettings;
private LinearLayout mLeftBar;
private TextView mTextViewClock;
private TextView mTextViewDate;
private Timer mTimer = null;
private boolean mOnResumeDirectlyAfterOnCreate = false;
@Override
protected void onCreate(Bundle savedInstanceState)
{
// Get settings provider
mSettings = SettingsProvider.getInstance(this);
// Check language
Log.d(MainActivity.class.getName(), "Set locale in onCreate");
setLocale();
// Set flag indicating we are in oncreate
mOnResumeDirectlyAfterOnCreate = true;
// Now go on
super.onCreate(savedInstanceState);
setContentView(R.layout.mainactivity);
// Get base linear layout
mMainLayout = (LinearLayout)findViewById(R.id.linearLayoutMain);
// Check if background image have to be set
WallpaperSelectDialog selectDialog = new WallpaperSelectDialog(this);
selectDialog.setWallpaper(false);
// Get linear layout for semi-transparent background
mSemiTransparentLayout = (LinearLayout) findViewById(R.id.linearLayoutSemiTransparentBackground);
// Get clock and date
mTextViewClock = (TextView)findViewById(R.id.textViewClock);
mTextViewDate = (TextView)findViewById(R.id.textViewDate);
// Get ListView
mListView = (ListView)findViewById(R.id.listView);
// Handle item click listener
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
Log.d(MainActivity.class.getName(), "OnItemClickListener: clicked position " + position);
handleLeftBarItemSelection(parent, view, position, id);
}
});
// Handle item selected changes
mListView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
{
Log.d(MainActivity.class.getName(), "OnItemSelectedListener: selected position " + position);
handleLeftBarItemSelection(parent, view, position, id);
}
@Override
public void onNothingSelected(AdapterView<?> parent)
{
}
});
// Set adapter
LeftBarItemsListAdapter actAdapter = new LeftBarItemsListAdapter(this);
mListView.setAdapter(actAdapter);
mListView.setSelection(0);
// Focus first item
mListView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
{
@Override
public void onGlobalLayout()
{
try
{
// Remove listener
mListView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
// Check if first icon have to be selected
mListView.requestFocusFromTouch();
mListView.setSelection(0);
}
catch (Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(MainActivity.class.getName(), "Failed to focus first left bar list item: \n" + errorReason);
}
}
});
// Check if left bar shall be hided
mLeftBar = (LinearLayout) findViewById(R.id.leftbar);
}
@Override
public void onResume()
{
// If not onResume directly after onCreate reset locale
if(!mOnResumeDirectlyAfterOnCreate)
{
Log.d(MainActivity.class.getName(), "Set locale again in onResume");
setLocale();
}
// Set date and time and start timer
setDateAndTime();
startTimer();
super.onResume();
}
@Override
public void onPause()
{
super.onPause();
// Stop update timer
stopTimer();
// Set back onResume directly after onCreate
mOnResumeDirectlyAfterOnCreate = false;
}
private void setActiveFragment(Fragment fragment)
{
try
{
// Check fragment type
if(fragment instanceof AppActivity)
{
// In app overview disable semi-transparent background
mSemiTransparentLayout.setBackgroundResource(android.R.color.transparent);
// Check if animation have to be changed
if(mSettings.getHideLeftBarInAppOverview())
{
mListView.setOnFocusChangeListener(new View.OnFocusChangeListener()
//mLeftBar.setOnFocusChangeListener(new View.OnFocusChangeListener()
{
@Override
public void onFocusChange(View v, boolean hasFocus)
{
Log.d(MainActivity.class.getName(), "LeftBar focus changed to: hasFocus = " + hasFocus);
if (mLastSetFragment instanceof AppActivity)
{
Integer newWidth = 0;
if (hasFocus)
{
newWidth = Math.round(getResources().getDimension(R.dimen.leftbarwidth));
}
Log.d(MainActivity.class.getName(), "LeftBar new width = " + newWidth);
ResizeWidthAnimation anim = new ResizeWidthAnimation(mLeftBar, newWidth);
anim.setDuration(300);
mLeftBar.startAnimation(anim);
}
}
});
}
else
{
mListView.setOnFocusChangeListener(null);
}
}
else
{
// In all other fragments enable semi-transparent background if setting is set
if(mSettings.getShowBackgroundForAppNames())
{
mSemiTransparentLayout.setBackgroundResource(R.color.semitransparentbackground_medium);
}
}
// Set fragment as lastSetFragment
mLastSetFragment = fragment;
// Initiate fragment change
FragmentManager fm = getFragmentManager();
FragmentTransaction fragmentTransaction = fm.beginTransaction();
fragmentTransaction.replace(R.id.item_detail_container, fragment);
fragmentTransaction.commit();
}
catch (Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(MainActivity.class.getName(), "Set Active Fragment: Exception: \n" + errorReason);
}
}
/**
* Handles selection or click of the left-bar items..
* @param parent
* @param view
* @param position
* @param id
*/
private void handleLeftBarItemSelection(AdapterView<?> parent, View view, int position, long id)
{
// Get instance of selected item and set as current fragment
try
{
Log.d(MainActivity.class.getName(), "HandleLeftBarItemSelection: selected position " + position);
// Create fragment
Fragment fragment = (Fragment)Class.forName(((LeftBarItemsListAdapter)parent.getAdapter()).getItem(position).className).getConstructor().newInstance();
// Set fragment
setActiveFragment(fragment);
}
catch (Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(MainActivity.class.getName(), "HandleLeftBarItemSelection: Exception: \n" + errorReason);
}
}
private void setLocale()
{
// Check language
String lang = mSettings.getLanguage();
if(lang != null && !lang.equals("") && SettingsProvider.LANG.containsKey(lang))
{
try
{
Locale newLocale;
// If lang is <= 3 chars, it is a language code
if(lang.length() <= 3)
{
newLocale = new Locale(lang);
}
else
{
newLocale = (Locale) Locale.class.getField(lang).get(Locale.getDefault());
}
Locale.setDefault(newLocale);
Configuration config = new Configuration(getResources().getConfiguration());
config.locale = newLocale;
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
}
catch (Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(MainActivity.class.getName(), "Failed to load custom language setting: \n" + errorReason);
}
}
}
/**
* Start the timer to update clock
*/
private void startTimer()
{
mTimer = new Timer ();
TimerTask timerTask = new TimerTask()
{
@Override
public void run()
{
setDateAndTime();
}
};
// Schedule task every full minute
Integer everyXminute = 1;
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Integer toBeAdded = everyXminute - (calendar.get(Calendar.MINUTE) % everyXminute);
if(toBeAdded == 0)
{
toBeAdded = everyXminute;
}
calendar.add(Calendar.MINUTE, toBeAdded);
mTimer.schedule(timerTask, calendar.getTime(), 1000*60*everyXminute);
Log.d(MainActivity.class.getName(), "Update Time started");
}
/**
* Stops the timer to update clock
*/
private void stopTimer()
{
if(mTimer != null)
{
mTimer.cancel();
mTimer = null;
}
Log.d(MainActivity.class.getName(), "Update Time stopped");
}
/**
* Sets the current time and date
*/
private void setDateAndTime()
{
runOnUiThread(new Runnable()
{
@Override
public void run()
{
// Get current date time
Date actDateTime = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss-SSS");
Log.d(MainActivity.class.getName(), "Update Time to " + sdf.format(actDateTime));
// Set clock
// DateFormat timeFormat = DateFormat.getTimeInstance(DateFormat.SHORT, getResources().getConfiguration().locale.getDefault());
// if(android.text.format.DateFormat.is24HourFormat(MainActivity.this))
// {
// }
// mTextViewClock.setText(timeFormat.format(actDateTime));
mTextViewClock.setText(DateUtils.formatDateTime(MainActivity.this, actDateTime.getTime(), DateUtils.FORMAT_SHOW_TIME));
// Set date
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, getResources().getConfiguration().locale);
mTextViewDate.setText(dateFormat.format(actDateTime));
}
});
}
/**
* @param drawable Set this drawable as background image
*/
public void setBackgroundImage(Drawable drawable)
{
mMainLayout.setBackground(drawable);
}
public Integer getBackgroundWidth()
{
return mMainLayout.getWidth();
}
public Integer getBackgroundHeight()
{
return mMainLayout.getHeight();
}
/** Trigger update */
public void triggerUpdate()
{
try
{
UpdaterActivity fragment = (UpdaterActivity)Class.forName(UpdaterActivity.class.getName()).getConstructor().newInstance();
fragment.triggerUpdateOnStartup();
setActiveFragment(fragment);
}
catch (Exception e)
{
e.printStackTrace();
}
}
@Override
public boolean onKeyDown(int keycode, KeyEvent e)
{
// Check if there is a receiver fragment
if(mLastSetFragment != null && mLastSetFragment instanceof CustomFragment)
{
CustomFragment actFragment = (CustomFragment)mLastSetFragment;
Boolean retVal = ((CustomFragment) mLastSetFragment).onKeyDown(keycode, e);
if(retVal)
{
return true;
}
}
return super.onKeyDown(keycode, e);
}
@Override
public void onBackPressed()
{
boolean isHandled = false;
// Check if there is a receiver fragment
if(mLastSetFragment != null && mLastSetFragment instanceof CustomFragment)
{
CustomFragment actFragment = (CustomFragment)mLastSetFragment;
isHandled = ((CustomFragment) mLastSetFragment).onBackPressed();
}
// Check if back-pressed is already handled
if(!isHandled)
{
// If the fragment does not handle the back-button and AppStarter is not
// on the main-app-view, open main-app-view
if(!(mLastSetFragment instanceof AppActivity))
{
mListView.setSelection(0);
}
}
// Prevent default by not calling super class..
}
}
@@ -0,0 +1,235 @@
package com.sidequest.launcher.gui;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.MultiSelectListPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.widget.Toast;
import java.util.List;
import java.util.Map;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.AppInfo;
import com.sidequest.launcher.tools.KodiUpdater;
import com.sidequest.launcher.tools.SettingsProvider;
import com.sidequest.launcher.tools.Tools;
/**
* Preferences activity
*/
public class PreferenceActivity extends PreferenceFragment
{
SettingsProvider mSettings = SettingsProvider.getInstance(this.getActivity());
SharedPreferences.OnSharedPreferenceChangeListener mSharedPreferenceListener = new SharedPreferences.OnSharedPreferenceChangeListener()
{
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
{
Thread readValuesThread = new Thread(new Runnable()
{
@Override
public void run()
{
mSettings.readValues(true);
}
});
readValuesThread.start();
}
};
public PreferenceActivity()
{
}
// @Override
// public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
// {
// View rootView = super.onCreateView(inflater, container, savedInstanceState);
//
// // Set padding to settings view:
// Integer pad = Math.round(getActivity().getResources().getDimension(R.dimen.settingspadding));
// Integer padBottom = Math.round(getActivity().getResources().getDimension(R.dimen.settingspadding_bottom));
// if (rootView != null)
// {
// rootView.setPadding(pad,pad,pad,padBottom);
// }
//
// return rootView;
// }
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferencesactivity);
InstalledAppsAdapter actAppsAdapter = new InstalledAppsAdapter(getActivity(), true, false);
List<AppInfo> actApps = actAppsAdapter.getAppList();
CharSequence[] entries = new CharSequence[actApps.size() + 1];
CharSequence[] entryValues = new CharSequence[actApps.size() + 1];
entries[0] = " - No Action - ";
entryValues[0] = "";
for (Integer i = 1; i < actApps.size() + 1; i++)
{
AppInfo actApp = actApps.get(i - 1);
entries[i] = actApp.getDisplayName();
entryValues[i] = actApp.packageName;
}
CharSequence[] langEntries = new CharSequence[SettingsProvider.LANG.size()];
CharSequence[] langValues = new CharSequence[SettingsProvider.LANG.size()];
Integer counter = 0;
for (Map.Entry<String, String> entry : SettingsProvider.LANG.entrySet())
{
langEntries[counter] = entry.getValue();
langValues[counter] = entry.getKey();
counter++;
}
ListPreference languagePreference = (ListPreference) findPreference("prefLanguage");
languagePreference.setEntries(langEntries);
languagePreference.setEntryValues(langValues);
languagePreference.setDefaultValue(mSettings.getLanguage());
languagePreference.setValue(mSettings.getLanguage());
languagePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
{
@Override
public boolean onPreferenceChange(Preference preference, Object newValue)
{
// Check if value has really changed:
if (!mSettings.getLanguage().equals(newValue.toString()))
{
// Force reload settings
mSettings.setLanguage(newValue.toString());
// Restart whole app
Tools.doRestart(PreferenceActivity.this.getActivity());
}
return true;
}
});
// ListPreference prefKodiUpdatePolicy = (ListPreference) findPreference("prefKodiUpdatePolicy");
// prefKodiUpdatePolicy.setEntries(KodiUpdater.UPDATE_POLICY.toArray(new CharSequence[KodiUpdater.UPDATE_POLICY.size()]));
// prefKodiUpdatePolicy.setEntryValues(KodiUpdater.UPDATE_POLICY.toArray(new CharSequence[KodiUpdater.UPDATE_POLICY.size()]));
// prefKodiUpdatePolicy.setDefaultValue(mSettings.getKodiUpdatePolicy());
// prefKodiUpdatePolicy.setValue(mSettings.getKodiUpdatePolicy());
InstalledAppsAdapter actHiddenAppsAdapter = new InstalledAppsAdapter(getActivity(), true, true);
List<AppInfo> actHiddenApps = actHiddenAppsAdapter.getAppList();
CharSequence[] hiddenEntries = new CharSequence[actHiddenApps.size()];
CharSequence[] hiddenEntryValues = new CharSequence[actHiddenApps.size()];
for (Integer i = 0; i < actHiddenApps.size(); i++)
{
AppInfo actApp = actHiddenApps.get(i);
hiddenEntries[i] = actApp.getDisplayName();
hiddenEntryValues[i] = actApp.packageName;
}
MultiSelectListPreference hiddenAppsList = (MultiSelectListPreference) findPreference("prefHiddenApps");
hiddenAppsList.setEntries(hiddenEntries);
hiddenAppsList.setEntryValues(hiddenEntryValues);
hiddenAppsList.setDefaultValue(mSettings.getHiddenApps());
EditTextPreference appIconSize = (EditTextPreference) findPreference("prefAppIconSize");
appIconSize.setDefaultValue(mSettings.getAppIconSize().toString());
appIconSize.setText(mSettings.getAppIconSize().toString());
appIconSize.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
{
@Override
public boolean onPreferenceChange(Preference preference, Object newValue)
{
return mSettings.setAppIconSize(newValue, true);
}
});
Preference prefWallpaper = (Preference) findPreference("prefWallpaper");
prefWallpaper.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
{
@Override
public boolean onPreferenceClick(Preference preference)
{
WallpaperSelectDialog wallpaperSelector = new WallpaperSelectDialog((MainActivity) PreferenceActivity.this.getActivity());
wallpaperSelector.show();
return false;
}
});
Preference prefExportCurrentSettings = (Preference) findPreference("prefExportCurrentSettings");
prefExportCurrentSettings.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
{
@Override
public boolean onPreferenceClick(Preference preference)
{
Toast.makeText(getActivity(), Tools.settingsExport(getActivity()), Toast.LENGTH_SHORT).show();
return false;
}
});
Preference prefImportCurrentSettings = (Preference) findPreference("prefImportCurrentSettings");
prefImportCurrentSettings.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
{
@Override
public boolean onPreferenceClick(Preference preference)
{
String retVal = Tools.settingsImport(getActivity());
if (retVal == null)
{
Toast.makeText(getActivity(), "Settings imported successful, restart..", Toast.LENGTH_SHORT).show();
Thread restarter = new Thread(new Runnable()
{
@Override
public void run()
{
try
{
Thread.sleep(2000);
}
catch (Exception ignore)
{
}
Tools.doRestart(getActivity());
}
});
restarter.start();
} else
{
Toast.makeText(getActivity(), retVal, Toast.LENGTH_SHORT).show();
}
return false;
}
});
}
@Override
public void onPause()
{
super.onPause();
PreferenceManager.getDefaultSharedPreferences(getActivity()).unregisterOnSharedPreferenceChangeListener(mSharedPreferenceListener);
// Force read-settings
mSettings.readValues(true);
}
@Override
public void onResume()
{
super.onResume();
PreferenceManager.getDefaultSharedPreferences(getActivity()).registerOnSharedPreferenceChangeListener(mSharedPreferenceListener);
}
}
@@ -0,0 +1,44 @@
package com.sidequest.launcher.gui;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;
/**
* Animate change of width
* https://stackoverflow.com/questions/16641539/animate-change-width-of-android-relativelayout
*/
public class ResizeWidthAnimation extends Animation
{
private int mWidth;
private int mStartWidth;
private View mView;
public ResizeWidthAnimation(View view, int width)
{
mView = view;
mWidth = width;
mStartWidth = view.getWidth();
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t)
{
int newWidth = mStartWidth + (int) ((mWidth - mStartWidth) * interpolatedTime);
mView.getLayoutParams().width = newWidth;
mView.requestLayout();
}
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight)
{
super.initialize(width, height, parentWidth, parentHeight);
}
@Override
public boolean willChangeBounds()
{
return true;
}
}
@@ -0,0 +1,117 @@
package com.sidequest.launcher.gui;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ListView;
import java.io.PrintWriter;
import java.io.StringWriter;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.AppStarterUpdater;
import com.sidequest.launcher.tools.SettingsProvider;
import com.sidequest.launcher.tools.Updater;
/**
* Shows the updates for all available installable apps including AppStarter itself
*/
public class UpdaterActivity extends Fragment
{
/** Instance of settings provider */
private SettingsProvider mSettings = SettingsProvider.getInstance(getActivity());
/** ListView to show all updateable apps */
private ListView mListView;
/** Indicates if update shall be triggered directly */
private Boolean mTriggerUpdate = false;
/** Updater apps adapter */
UpdaterAppsAdapter mUpdaterAppsAdapter;
/** Mandatory for fragment initation */
public UpdaterActivity(){ }
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View rootView = inflater.inflate(R.layout.updateractivity, container, false);
// Get ListView
mListView = (ListView) rootView.findViewById(R.id.listView);
// Set updateable apps adapter
mUpdaterAppsAdapter = new UpdaterAppsAdapter(this.getActivity());
mListView.setAdapter(mUpdaterAppsAdapter);
// Make buttons useable
mListView.setItemsCanFocus(true);
mListView.setFocusable(false);
mListView.setFocusableInTouchMode(false);
mListView.setClickable(false);
// Trigger update mechanism when first view is ready..
mListView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
{
@Override
public void onGlobalLayout()
{
try
{
// Remove listener
mListView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
if(mTriggerUpdate)
{
mTriggerUpdate = false;
Updater actAppStarterUpdater = (Updater) mUpdaterAppsAdapter.getItem(0);
if(actAppStarterUpdater != null && actAppStarterUpdater instanceof AppStarterUpdater)
{
actAppStarterUpdater.DialogHandler.performUpdate();
}
}
}
catch (Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(MainActivity.class.getName(), "Failed to trigger update directly: \n" + errorReason);
}
}
});
return rootView;
}
/** Trigger update programmtically */
public void triggerUpdateOnStartup()
{
mTriggerUpdate = true;
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
@Override
public void onPause()
{
super.onPause();
}
@Override
public void onResume()
{
super.onResume();
mUpdaterAppsAdapter.notifyDataSetChanged();
}
}
@@ -0,0 +1,174 @@
package com.sidequest.launcher.gui;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.AppStarterUpdater;
import com.sidequest.launcher.tools.KodiUpdater;
import com.sidequest.launcher.tools.SPMCUpdater;
import com.sidequest.launcher.tools.SettingsProvider;
import com.sidequest.launcher.tools.Updater;
/**
* Adapter that lists all installed apps
*/
public class UpdaterAppsAdapter extends BaseAdapter
{
Activity mActivity;
private List<Updater> mUpdaterList;
/**
* Create new UpdaterAppsadapter
*/
public UpdaterAppsAdapter(Activity activity)
{
// Set context
mActivity = activity;
// Set list of updaters
mUpdaterList = new ArrayList<>();
mUpdaterList.add(new AppStarterUpdater());
mUpdaterList.add(new KodiUpdater(activity));
mUpdaterList.add(new SPMCUpdater());
}
/**
* @return Count of installed apps
*/
public int getCount()
{
return mUpdaterList.size();
}
/**
* @param position Position of item to be returned
* @return Item on position
*/
public Object getItem(int position)
{
return mUpdaterList.get(position);
}
/**
* Currently not used..
*/
public long getItemId(int position)
{
return position;
}
/**
* @return View of the given position
*/
public View getView(int position, View convertView, ViewGroup parent)
{
// Get act updater
final Updater actUpdater = mUpdaterList.get(position);
// Inflate layout
View rootView;
if (convertView == null)
{
LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rootView = new View(mActivity);
rootView = inflater.inflate(R.layout.appupdateritemlayout, parent, false);
}
else
{
rootView = (View) convertView;
}
// Set title
TextView textViewTitle = (TextView) rootView.findViewById(R.id.title);
textViewTitle.setText(actUpdater.getAppName());
// Set current version
TextView textViewCurrentVersion = (TextView) rootView.findViewById(R.id.currentVersion);
textViewCurrentVersion.setText(actUpdater.getCurrentVersion(mActivity));
// Set latest version
final TextView textViewLatestVersion = (TextView) rootView.findViewById(R.id.latestVersion);
String latestVersion = actUpdater.getLatestVersion();
if(latestVersion == null)
{
latestVersion = mActivity.getResources().getString(R.string.update_hitcheckfor);
}
textViewLatestVersion.setText(latestVersion);
// Create an UpdaterDialogHandler
final UpdaterDialogHandler updaterDialogHandler = new UpdaterDialogHandler(mActivity, actUpdater);
actUpdater.DialogHandler = updaterDialogHandler;
updaterDialogHandler.setCheckForUpdateFinishedListener(new Updater.OnCheckForUpdateFinishedListener()
{
@Override
public void onCheckForUpdateFinished(String message)
{
if (actUpdater.getLatestVersion() != null)
{
if (actUpdater.isVersionNewer(actUpdater.getCurrentVersion(mActivity), actUpdater.getLatestVersion()))
{
textViewLatestVersion.setText(actUpdater.getLatestVersion() + " - " + mActivity.getResources().getString(R.string.update_foundnew));
if (actUpdater instanceof AppStarterUpdater)
{
AppActivity.LATEST_APP_VERSION = actUpdater.getLatestVersion();
}
} else
{
textViewLatestVersion.setText(actUpdater.getLatestVersion() + " - " + mActivity.getResources().getString(R.string.update_foundnotnew));
}
} else
{
textViewLatestVersion.setText(message);
}
}
});
// Set the button onclicks
Button checkUpdateButton = (Button) rootView.findViewById(R.id.buttonCheckForUpdate);
checkUpdateButton.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
updaterDialogHandler.checkForUpdate();
}
});
Button updateButton = (Button) rootView.findViewById(R.id.buttonUpdate);
updateButton.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
updaterDialogHandler.performUpdate();
if(actUpdater instanceof AppStarterUpdater)
{
SettingsProvider settings = SettingsProvider.getInstance(mActivity);
settings.setHaveUpdateSeen(false);
}
}
});
if(rootView.getResources().getString(R.string.not_installed).equals(textViewCurrentVersion.getText()))
{
// App is not installed, change update to install text
updateButton.setText(rootView.getResources().getString(R.string.install));
}
return rootView;
}
}
@@ -0,0 +1,116 @@
package com.sidequest.launcher.gui;
import android.app.Activity;
import android.app.ProgressDialog;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.AppStarterUpdater;
import com.sidequest.launcher.tools.Updater;
/**
* Handles the update-dialogs in case of an update
*/
public class UpdaterDialogHandler
{
/** Updater of the dialog handler */
private Updater mUpdater;
/** Context of the current dialog handler */
private Activity mActivity;
/** Check for update progress */
ProgressDialog mCheckForUpdateProgress = null;
/** Update progress */
ProgressDialog mUpdateProgress = null;
/** Listener for checkforupdate finished event */
Updater.OnCheckForUpdateFinishedListener mCheckForUpdateFinishedListener = null;
public UpdaterDialogHandler(Activity activity, Updater updater)
{
mActivity = activity;
mUpdater = updater;
mUpdater.setOnCheckForUpdateFinishedListener(mOnCheckForUpdateFinishedListener);
mUpdater.setOnUpdateProgressListener(mOnUpdateProgressListener);
}
public void setCheckForUpdateFinishedListener(Updater.OnCheckForUpdateFinishedListener listener)
{
mCheckForUpdateFinishedListener = listener;
}
public void checkForUpdate()
{
mCheckForUpdateProgress = ProgressDialog.show(mActivity, mActivity.getResources().getString(R.string.update_checkfortitle), mActivity.getResources().getString(R.string.update_checkfordesc), true);
mUpdater.checkForUpdate();
}
public void performUpdate()
{
mUpdateProgress = new ProgressDialog(mActivity);
mUpdateProgress.setMessage(mActivity.getResources().getString(R.string.update_checkformessage));
mUpdateProgress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mUpdateProgress.setCancelable(false);
mUpdateProgress.setProgress(0);
mUpdateProgress.show();
mUpdater.update(mActivity);
}
/** Handle check for update */
Updater.OnCheckForUpdateFinishedListener mOnCheckForUpdateFinishedListener = new AppStarterUpdater.OnCheckForUpdateFinishedListener()
{
@Override
public void onCheckForUpdateFinished(final String message)
{
mActivity.runOnUiThread(new Runnable()
{
@Override
public void run()
{
if (mCheckForUpdateProgress != null)
{
mCheckForUpdateProgress.dismiss();
mCheckForUpdateProgress = null;
}
mCheckForUpdateFinishedListener.onCheckForUpdateFinished(message);
}
});
}
};
/** Handle update progress */
Updater.OnUpdateProgressListener mOnUpdateProgressListener = new AppStarterUpdater.OnUpdateProgressListener()
{
@Override
public void onUpdateProgress(final Boolean isError,final Integer percent, final String message)
{
mActivity.runOnUiThread(new Runnable()
{
@Override
public void run()
{
if (isError)
{
mUpdateProgress.setProgress(100);
mUpdateProgress.setMessage(message);
mUpdateProgress.setCancelable(true);
} else
{
mUpdateProgress.setProgress(percent);
mUpdateProgress.setMessage(message);
if (percent >= 100)
{
mUpdateProgress.setCancelable(true);
mUpdateProgress.dismiss();
}
}
}
});
}
};
}
@@ -0,0 +1,173 @@
package com.sidequest.launcher.gui;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import com.sidequest.launcher.R;
import com.sidequest.launcher.tools.Tools;
/**
* Created by luki on 28.06.15.
*/
public class WallpaperSelectDialog
{
/** Current MainActivity */
MainActivity mMainActivity;
/** Current Wallpaper Path */
File mWallpaperPath;
public WallpaperSelectDialog(MainActivity mainActivity)
{
mMainActivity = mainActivity;
mWallpaperPath = new File(mMainActivity.getApplicationInfo().dataDir, "wallpaper.png");
}
public void setWallpaper(Boolean forceError)
{
try
{
if(!forceError)
{
if(!mWallpaperPath.exists())
{
return;
}
}
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
Bitmap bitmap = BitmapFactory.decodeFile(mWallpaperPath.getAbsolutePath(), bmOptions);
BitmapDrawable drawable = new BitmapDrawable(mMainActivity.getResources(), bitmap);
mMainActivity.setBackgroundImage(drawable);
}
catch(Exception e)
{
Toast.makeText(mMainActivity, "Could not set wallpaper", Toast.LENGTH_SHORT).show();
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(WallpaperSelectDialog.class.getName(), "Failed to set background: \n" + errorReason);
}
}
public void show()
{
AlertDialog.Builder builder = new AlertDialog.Builder(mMainActivity);
builder.setTitle("JPG/PNG - 1920x1080px");
List<String> items = new ArrayList<String>();
if(mWallpaperPath.exists())
{
items.add(mMainActivity.getResources().getString(R.string.remove_wallpaper));
}
items.add(mMainActivity.getResources().getString(R.string.select_wallpaper));
final String[] itemList = items.toArray(new String[items.size()]);
builder.setItems(itemList, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
dialog.cancel();
dialog.dismiss();
String itemChosen = itemList[which];
if (itemChosen == mMainActivity.getResources().getString(R.string.remove_wallpaper))
{
deleteWallpaper();
}
else if(itemChosen == mMainActivity.getResources().getString(R.string.select_wallpaper))
{
showFileSelectorDialog();
}
}
});
Dialog dialog = builder.show();
dialog.show();
}
private void deleteWallpaper()
{
if(mWallpaperPath.exists())
{
mWallpaperPath.delete();
Tools.doRestart(mMainActivity);
}
}
private void showFileSelectorDialog()
{
File mPath = Environment.getExternalStorageDirectory();
FileDialog fileDialog = new FileDialog(mMainActivity, mPath);
fileDialog.setFileEndsWith(new String[]{".jpg", ".jpeg", ".png"});
fileDialog.addFileListener(new FileDialog.FileSelectedListener()
{
public void fileSelected(File file)
{
WallpaperSelectDialog.this.handleFileSelected(file);
}
});
//fileDialog.addDirectoryListener(new FileDialog.DirectorySelectedListener() {
// public void directorySelected(File directory) {
// Log.d(getClass().getName(), "selected dir " + directory.toString());
// }
//});
//fileDialog.setSelectDirectoryOption(false);
fileDialog.showDialog();
}
private void handleFileSelected(File file)
{
// Now we try to resize and set this file
try
{
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath(), bmOptions);
// Resize image
bitmap = Tools.resizeBitmapToFit(bitmap, mMainActivity.getBackgroundWidth(), mMainActivity.getBackgroundHeight());
File dir = mWallpaperPath.getParentFile();
if(!dir.exists())
{
dir.mkdirs();
}
if(mWallpaperPath.exists())
{
mWallpaperPath.delete();
}
FileOutputStream fOut = new FileOutputStream(mWallpaperPath);
bitmap.compress(Bitmap.CompressFormat.PNG, 90, fOut);
fOut.flush();
fOut.close();
// Now try to load this one
setWallpaper(true);
}
catch(Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(MainActivity.class.getName(), "Failed to set background: \n" + errorReason);
}
}
}
@@ -0,0 +1,16 @@
package com.sidequest.launcher.tests;
import android.test.InstrumentationTestCase;
import com.sidequest.launcher.tools.KodiUpdater;
/**
* Created by attila.szasz on 23-Oct-15.
*/
public class KodiTests extends InstrumentationTestCase {
public void testCheckForUpdate() throws Exception {
KodiUpdater mKodiUpdater = new KodiUpdater(this.getInstrumentation().getContext());
mKodiUpdater.checkForUpdate(true);
assertNotNull("Latest version should not be null", mKodiUpdater.getLatestVersion());
}
}
@@ -0,0 +1,44 @@
package com.sidequest.launcher.tools;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.graphics.drawable.Drawable;
/**
* Container to hold app informations
*/
public class AppInfo extends ApplicationInfo
{
/** The current context */
Context mContext;
/**
* @param app App to be hold
*/
public AppInfo(Context context, ApplicationInfo app)
{
super(app);
mContext = context;
}
/**
* @return Name to be displayed
*/
public String getDisplayName()
{
String retVal = this.loadLabel(mContext.getPackageManager()).toString();
if(retVal == null || retVal.equals(""))
{
retVal = packageName;
}
return retVal;
}
/**
* @return Icon to be displayed
*/
public Drawable getDisplayIcon()
{
return this.loadIcon(mContext.getPackageManager());
}
}
@@ -0,0 +1,144 @@
package com.sidequest.launcher.tools;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.provider.Settings;
import android.util.Log;
import java.io.PrintWriter;
import java.io.StringWriter;
import com.sidequest.launcher.gui.InstalledAppsAdapter;
/**
* Provides methods to start apps
*/
public class AppStarter
{
/** Name of the launcher package */
private static String mLauncherPackageName = null;
/** Thread to start and watch if correct action is happening */
private static Thread mStartAndWatchThread = null;
private static Object mSyncObj = new Object();
public static void stopWatchThread()
{
synchronized (mSyncObj)
{
Log.d(AppStarter.class.getName(), "Stop watch thread");
try
{
if(mStartAndWatchThread != null && mStartAndWatchThread.isAlive())
{
mStartAndWatchThread.interrupt();
mStartAndWatchThread.join();
mStartAndWatchThread = null;
Log.d(AppStarter.class.getName(), "Watchthread stopped");
}
else
{
Log.d(AppStarter.class.getName(), "Watchthread was not alive, nothing to be done.");
}
}
catch(Exception e)
{
Log.d(AppStarter.class.getName(), "Exception while stopping watchthread: \n" + e.getMessage());
}
}
}
/**
* Starting an app by its package-name
* @param context Context in that the app shall be started.
* @param packageName Name of the apps package
* @param isClickAction Indicates if this method is initiated by a click-action
*/
public static void startAppByPackageName(final Context context, String packageName, Boolean isClickAction, Boolean isStartupAction, Boolean isClearPreviousInstancesForced)
{
try
{
// If currently a watchdog thread is running, stop it first
stopWatchThread();
synchronized (mSyncObj)
{
if (packageName != null && !packageName.equals(""))
{
// Prepare the intent
final Intent launchIntent = InstalledAppsAdapter.getLaunchableIntentByPackageName(context, packageName);
if (isStartupAction || isClearPreviousInstancesForced)
{
// Start in new Task if startup -> perhaps prevents weird colors of kodi
// that some users reported..
Log.d(AppStarter.class.getName(), "Using FLAG_ACTIVITY_CLEAR_TASK: isStartupAction=" + isStartupAction.toString() + ", isClearPreviousInstancesForced=" + isClearPreviousInstancesForced.toString());
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
}
// Launch the intent
Log.d(AppStarter.class.getName(), "Starting launcher activity of package: " + packageName);
context.startActivity(launchIntent);
}
}
}
catch(Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(AppStarter.class.getName(), "Failed to launch activity: \n" + errorReason);
}
}
/**
* Start settings view by packagename
* @param context
* @param packageName
*/
public static void startSettingsViewByPackageName(Context context, String packageName)
{
try
{
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.fromParts("package", packageName, null));
context.startActivity(intent);
}
catch(Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(AppStarter.class.getName(), "Failed to launch settings-activity: \n" + errorReason);
}
}
/**
* Uses package manager to find the package name of the device launcher. Usually this package
* is "com.android.launcher" but can be different at times. This is a generic solution which
* works on all platforms.`
*/
public static synchronized String getLauncherPackageName(Context context)
{
// We only need to find the launcher package once as it should not change
if(mLauncherPackageName == null)
{
// Create launcher Intent
final Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
// Use PackageManager to get the launcher package name
PackageManager pm = context.getPackageManager();
ResolveInfo resolveInfo = pm.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
mLauncherPackageName = resolveInfo.activityInfo.packageName;
}
return mLauncherPackageName;
}
}
@@ -0,0 +1,86 @@
package com.sidequest.launcher.tools;
import android.content.Context;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.net.URL;
import java.util.Scanner;
/**
* Update class for AppStarter
*/
public class AppStarterUpdater extends Updater
{
/** Update URL where updated versions are found */
private String mUpdateUrl = "https://api.github.com/repos/sphinx02/AppStarter/releases";
@Override
public String getAppName()
{
return "AppStarter";
}
@Override
public String getPackageName(Context context)
{
return context.getApplicationInfo().packageName;
}
@Override
public Boolean isVersionNewer(String oldVersion, String newVersion)
{
// Use standard check
return isVersionNewerStandardCheck(oldVersion, newVersion);
}
@Override
protected void updateLatestVersionAndApkDownloadUrl() throws Exception
{
// Build the url
URL url = new URL(mUpdateUrl);
// Read from the URL
Scanner scan = new Scanner(url.openStream());
StringBuilder str = new StringBuilder();
while (scan.hasNext())
{
str.append(scan.nextLine());
}
scan.close();
// build a JSON object
JSONArray obj = new JSONArray(str.toString());
if(obj.length() <= 0)
{
throw new JSONException("No content found");
}
JSONObject latestRelease = obj.getJSONObject(0);
String tagName = latestRelease.getString("tag_name");
if(tagName == null || tagName.equals(""))
{
throw new JSONException("Latest release tag name is empty");
}
mLatestVersion = tagName;
// Search for apk-download url
JSONArray assets = latestRelease.getJSONArray("assets");
for(Integer i = 0; i < assets.length(); i++)
{
JSONObject currentAsset = assets.getJSONObject(i);
String downloadUrl = currentAsset.getString("browser_download_url");
if(downloadUrl.startsWith("https://github.com/sphinx02/") && downloadUrl.endsWith(".apk"))
{
mApkDownloadUrl = downloadUrl;
break;
}
}
if(mApkDownloadUrl == null)
{
throw new JSONException("No .apk download URL found");
}
}
}
@@ -0,0 +1,237 @@
package com.sidequest.launcher.tools;
import android.content.Context;
import android.util.Log;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import java.util.ArrayList;
import java.util.List;
public class KodiUpdater extends Updater
{
public static List<String> UPDATE_POLICY = new ArrayList<String>()
{
{
add("Stable");
add("Beta and RC");
add("Nightly Builds");
}
};
/** Update URL where updated versions are found */
private String mUpdateUrl = "http://mirrors.kodi.tv/releases/android/arm/";
/** Update URL for nightly versions */
private String mUpdateUrlNightly = "http://mirrors.kodi.tv/nightlies/android/arm/";
/** Current context */
private Context mContext;
/** Instance of settings */
private SettingsProvider mSettings;
/** Constructor to get Context */
public KodiUpdater(Context context)
{
mContext = context;
mSettings = SettingsProvider.getInstance(context);
}
@Override
public String getAppName()
{
return "Kodi";
}
@Override
public String getPackageName(Context context)
{
return "org.xbmc.kodi";
}
@Override
public Boolean isVersionNewer(String oldVersion, String newVersion)
{
// // Kodi versiong String can have additional RC-Version which is lower
// // than equal version String without RC-Version
// Boolean retVal = false;
//
// // Start do-while-false to be able to break out any time
// do
// {
// // First prepare Strings
// String workOldVersion = oldVersion.replace("_", "-").toUpperCase();
// String workNewVersion = newVersion.replace("_", "-").toUpperCase();
//
// // If Strings are now equal, version is not newer
// if(workOldVersion.equals(workNewVersion))
// {
// retVal = false;
// break;
// }
//
// // Split version Strings
// String[] splitOldVersion = workOldVersion.split("-");
// String[] splitNewVersion = workNewVersion.split("-");
//
// // We should have at least one version string
// if(splitOldVersion.length < 1 || splitNewVersion.length < 1)
// {
// retVal = false;
// break;
// }
//
// // If the first part (the normal version string) is identical
// // we have to perform further tests
// if(splitOldVersion[0].equals(splitNewVersion[0]))
// {
// // If only the oldversion string has the rc-part,
// // the version is newer as no rc-part is newer than any rc-part
// if(splitOldVersion.length == 2 && splitNewVersion.length == 1)
// {
// retVal = true;
// break;
// }
//
// // If both have the rc-part, we have to compare the rc part
// if(splitOldVersion.length == 2 && splitNewVersion.length == 2)
// {
// try
// {
// String oldRc = splitOldVersion[1];
// String newRc = splitNewVersion[1];
//
// if(oldRc.startsWith("RC") && newRc.startsWith("RC"))
// {
// oldRc = oldRc.substring(2, oldRc.length());
// newRc = newRc.substring(2, newRc.length());
// Integer oldInt = Integer.valueOf(oldRc);
// Integer newInt = Integer.valueOf(newRc);
// if(newInt > oldInt)
// {
// retVal = true;
// break;
// }
// }
// else if(oldRc.startsWith("BETA") && newRc.startsWith("RC"))
// {
// retVal = true;
// }
// }
// catch(Exception ignore){}
// break;
// }
// }
//
// // Else we use the standard check for the main-version part
// retVal = isVersionNewerStandardCheck(splitOldVersion[0], splitNewVersion[0]);
//
// }
// while(false);
// Too complex, we simply check if the versions are equal or not
Boolean retVal = false;
String workOldVersion = oldVersion.replace("_", "-").toUpperCase();
String workNewVersion = newVersion.replace("_", "-").toUpperCase();
if(!workOldVersion.equals(workNewVersion))
{
retVal = true;
}
return retVal;
}
@Override
protected void updateLatestVersionAndApkDownloadUrl() throws Exception
{
String updatePolicy = mSettings.getKodiUpdatePolicy();
String updateUrl = mUpdateUrl;
Log.d("KODI-UPDATER", "Policy: " + updatePolicy);
if(updatePolicy.equals(UPDATE_POLICY.get(2)))
{
// Change link to nightlies
updateUrl = mUpdateUrlNightly;
}
Document doc = Jsoup.connect(updateUrl).get();
Elements files = doc.select("#list tbody tr");
String latestApk = "";
for(int i = 0; i < files.size(); i++)
{
String foundApk = files.get(i).select("td").first().text();
Log.d("KODI-UPDATER", "Found: " + foundApk);
if(foundApk.toLowerCase().endsWith(".apk"))
{
if(updatePolicy.equals(UPDATE_POLICY.get(1)) || updatePolicy.equals(UPDATE_POLICY.get(2)))
{
// We use the first file with .apk ending
latestApk = foundApk;
break;
}
else
{
// We have to check if this is no RC, ALPHA, OR BETA
String replacedApkName = foundApk.replace("_", "-").toUpperCase();
String[] splitApkName = replacedApkName.split("-");
if(splitApkName.length < 4 || (!splitApkName[3].startsWith("RC") && !splitApkName[3].startsWith("BETA") && !splitApkName[3].startsWith("ALPHA")))
{
latestApk = foundApk;
break;
}
}
}
}
if(latestApk.equals(""))
{
throw new Exception("No apk found on: " + mUpdateUrl);
}
mApkDownloadUrl = updateUrl + latestApk;
mLatestVersion = getVersion(latestApk);
}
/**
* Get version from file name
* @param apkName file name to be parsedf
* @return Version string
*/
private static String getVersion(String apkName)
{
String retVal = null;
try
{
if(apkName != null && !apkName.equals(""))
{
// apkName = apkName
// .replace("kodi-", "")
// .replace("-Isengard", "")
// .replace("-Jarvis", "")
// .replace("_rc", "-RC")
// .replace("_alpha", "-ALPHA")
// .replace("-armeabi-v7a.apk", "");
// retVal = "v" + apkName;
// We try to split up the kodi apk name into parts
// and check the correct parts
String replacedApkName = apkName.replace("_", "-").toUpperCase();
String[] splitApkName = replacedApkName.split("-");
if(splitApkName.length >= 2)
{
retVal = "v" + splitApkName[1];
}
if(splitApkName.length >= 4 && splitApkName[3].startsWith("RC") || splitApkName[3].startsWith("BETA") || splitApkName[3].startsWith("ALPHA"))
{
retVal += "-" + splitApkName[3];
}
}
}
catch(Exception ignore) { }
return retVal;
}
}
@@ -0,0 +1,96 @@
package com.sidequest.launcher.tools;
import android.content.Context;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.net.URL;
import java.util.Scanner;
/**
* Handles updates for SPMC
*/
public class SPMCUpdater extends Updater
{
/** Update URL where updated versions are found */
private String mUpdateUrl = "https://api.github.com/repos/koying/SPMC/releases";
@Override
public String getAppName()
{
return "SPMC";
}
@Override
public String getPackageName(Context context)
{
return "com.semperpax.spmc16";
}
@Override
public Boolean isVersionNewer(String oldVersion, String newVersion)
{
// Use standard check
return isVersionNewerStandardCheck(oldVersion, newVersion);
}
@Override
public String getCurrentVersion(Context context)
{
return Tools.getCurrentAppVersion(context, getPackageName(context)).replace("-", ".");
}
@Override
protected void updateLatestVersionAndApkDownloadUrl() throws Exception
{
// Build the url
URL url = new URL(mUpdateUrl);
// Read from the URL
Scanner scan = new Scanner(url.openStream());
StringBuilder str = new StringBuilder();
while (scan.hasNext())
{
str.append(scan.nextLine());
}
scan.close();
// build a JSON object
JSONArray obj = new JSONArray(str.toString());
if(obj.length() <= 0)
{
throw new JSONException("No content found");
}
JSONObject latestRelease = obj.getJSONObject(0);
String tagName = latestRelease.getString("tag_name");
if(tagName == null || tagName.equals(""))
{
throw new JSONException("Latest release tag name is empty");
}
mLatestVersion = "v" + tagName.replaceAll("[^\\d.]", "");
// Search for apk-download url
JSONArray assets = latestRelease.getJSONArray("assets");
for(Integer i = 0; i < assets.length(); i++)
{
JSONObject currentAsset = assets.getJSONObject(i);
String downloadUrl = currentAsset.getString("browser_download_url");
if(downloadUrl.startsWith("https://github.com/koying/SPMC/releases")
&& downloadUrl.endsWith(".apk")
&& downloadUrl.toLowerCase().contains("arm")
&& !(downloadUrl.toLowerCase().contains("launcher")))
{
mApkDownloadUrl = downloadUrl;
break;
}
}
if(mApkDownloadUrl == null)
{
throw new JSONException("No .apk download URL found");
}
}
}
@@ -0,0 +1,402 @@
package com.sidequest.launcher.tools;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.Toast;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Semaphore;
import com.sidequest.launcher.R;
/**
* Settings Provider to store all Settins of the app
*/
public class SettingsProvider
{
/** Map of possible languages */
public static final Map<String, String> LANG = new LinkedHashMap<String, String>()
{{
// Key is the static field name of Locale (e.g. Locale.GERMAN or Locale.ENGLISH)
// Value is the displayed value for the settings
put("", "Auto");
put("GERMAN", "Deutsch");
put("ENGLISH", "English");
//put("hu", "Magyar");
put("ru", "Русский");
put("uk", "Українська");
}};
/** Private static singleton object */
private static SettingsProvider _instance;
/** Semaphore to limit readValues and writeValues access */
private static Semaphore mSemaphore = new Semaphore(1);
/** Synchronized singleton getter (Thread Safe) */
public static synchronized SettingsProvider getInstance (Context context)
{
if(SettingsProvider._instance == null)
{
SettingsProvider._instance = new SettingsProvider(context);
}
return SettingsProvider._instance;
}
/** Stored context */
Context mContext;
/** Instance of app-shared preferences */
SharedPreferences mPreferences;
/** Indicator for package-order */
final static String PACKAGEORDER = "packageorder_";
/** Indicates if settings are already loaded */
Boolean mIsLoaded = false;
/** Package-Order List */
List<String> mPackageOrder = new ArrayList<String>();
/** Language string */
String mLanguage = "";
/** Update policy of Kodi */
String mKodiUpdatePolicy = KodiUpdater.UPDATE_POLICY.get(0);
/** List of hidden apps */
Set<String> mHiddenAppsList = new HashSet<String>();
/** Show system apps */
Boolean mShowSystemApps = false;
/** Size of the app icons */
Integer mAppIconSize = 0;
/** Indicates if user have seen update but do not want to update */
Boolean mHaveUpdateSeen = false;
/** Automatically select first icon when switching to app-drawer */
Boolean mAutoSelectFirstIcon = true;
/** Indicates if the LeftBar is hided when on the app overview */
Boolean mHideLeftBarInAppOverview = false;
/** Indicates if app names in the app drawer are having a background */
Boolean mShowBackgroundForAppNames = false;
/** Create a the instace of SettingsProvider */
private SettingsProvider(Context context)
{
mContext = context;
mPreferences = PreferenceManager.getDefaultSharedPreferences(context);
}
/**
* Set order of packages for app-drawer
* @param packageOrder List of packagenames in correct order
*/
public void setPackageOrder(List<String> packageOrder)
{
mPackageOrder = packageOrder;
storeValues();
}
/**
* @return List of packagenames in last saved order
*/
public List<String> getPackageOrder()
{
readValues();
return mPackageOrder;
}
public void setHideLeftBarInAppOverview(Boolean value)
{
mHideLeftBarInAppOverview = value;
storeValues();
}
public Boolean getHideLeftBarInAppOverview()
{
readValues();
return mHideLeftBarInAppOverview;
}
public void setShowBackgroundForAppNames(Boolean value)
{
mShowBackgroundForAppNames = value;
storeValues();
}
public Boolean getShowBackgroundForAppNames()
{
readValues();
return mShowBackgroundForAppNames;
}
public void setHaveUpdateSeen(Boolean value)
{
mHaveUpdateSeen = value;
storeValues();
}
public Boolean getHaveUpdateSeen()
{
readValues();
return mHaveUpdateSeen;
}
public void setAutoSelectFirstIcon(Boolean value)
{
mAutoSelectFirstIcon = value;
storeValues();
}
public Boolean getAutoSelectFirstIcon()
{
readValues();
return mAutoSelectFirstIcon;
}
public void setKodiUpdatePolicy(String policy)
{
mKodiUpdatePolicy = policy;
storeValues();
}
public String getKodiUpdatePolicy()
{
readValues();
return mKodiUpdatePolicy;
}
public void setLanguage(String language)
{
mLanguage = language;
storeValues();
}
public String getLanguage()
{
readValues();
return mLanguage;
}
public void setHiddenApps(Set<String> hiddenApps)
{
mHiddenAppsList = hiddenApps;
storeValues();
}
public Set<String> getHiddenApps()
{
readValues();
return mHiddenAppsList;
}
public void setShowSystemApps(Boolean value)
{
mShowSystemApps = value;
storeValues();
}
public Boolean getShowSystemApps()
{
readValues();
return mShowSystemApps;
}
public Boolean setAppIconSize(Object appIconSize, Boolean simulate)
{
Boolean retVal = numberCheck(appIconSize, 0, 200);
if(!simulate && retVal)
{
setAppIconSize(Integer.valueOf(appIconSize.toString()));
}
return retVal;
}
public void setAppIconSize(Integer appIconSize)
{
mAppIconSize = appIconSize;
storeValues();
}
public Integer getAppIconSize()
{
readValues();
return mAppIconSize;
}
private boolean numberCheck(Object newValue, Integer min, Integer max)
{
Boolean retVal = false;
try
{
if(!newValue.toString().equals("") && newValue.toString().matches("\\d*") )
{
Integer value = Integer.valueOf(newValue.toString());
if(value >= min && value <= max)
{
retVal = true;
}
}
}
catch(Exception ignore){}
if(!retVal)
{
Toast.makeText(mContext, newValue + " " + mContext.getResources().getString(R.string.is_invalid_number), Toast.LENGTH_SHORT).show();
}
return retVal;
}
/**
* Read values from settings
*/
public void readValues()
{
readValues(false);
}
/**
* @param forceRead Force reading values from preferences
*/
public void readValues(Boolean forceRead)
{
try
{
// ATTENTION: NEVER CALL ONE OF THE GETTERS OR SETTERS IN HERE!
// Aquire semaphore
mSemaphore.acquire();
// Load only once (hold in singleton)
if (mIsLoaded && !forceRead)
{
mSemaphore.release();
return;
}
// PackageList
List<String> packageList = new ArrayList<String>();
Integer size = mPreferences.getInt(PACKAGEORDER + "size", 0);
for (Integer i = 0; i < size; i++)
{
String actKey = PACKAGEORDER + i.toString();
packageList.add(mPreferences.getString(actKey, null));
}
mPackageOrder = packageList;
// HideLeftBarInAppOverview
mHideLeftBarInAppOverview = mPreferences.getBoolean("prefHideLeftBarInAppOverview", mHideLeftBarInAppOverview);
// ShowBackgroundForAppNames
mShowBackgroundForAppNames = mPreferences.getBoolean("prefShowBackgroundForAppNames", mShowBackgroundForAppNames);
// Have update seen
mHaveUpdateSeen = mPreferences.getBoolean("prefHaveUpdateSeen", mHaveUpdateSeen);
// Auto select first icon
mAutoSelectFirstIcon = mPreferences.getBoolean("prefAutoSelectFirstIcon", mAutoSelectFirstIcon);
// HiddenApps-List
mHiddenAppsList = mPreferences.getStringSet("prefHiddenApps", mHiddenAppsList);
// Show sys apps
mShowSystemApps = mPreferences.getBoolean("prefShowSysApps", mShowSystemApps);
// lang
mLanguage = mPreferences.getString("prefLanguage", mLanguage);
// Kodi update policy
mKodiUpdatePolicy = mPreferences.getString("prefKodiUpdatePolicy", mKodiUpdatePolicy);
// App icon size
String pref = mPreferences.getString("prefAppIconSize", mAppIconSize.toString());
if(setAppIconSize(pref, true))
{
mAppIconSize = Integer.valueOf(pref);
}
// Set is loaded flag
mIsLoaded = true;
}
catch(Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(SettingsProvider.class.getName(), "Exception while reading settings: \n" + errorReason);
}
mSemaphore.release();
}
/**
* Store values to settings
*/
public void storeValues()
{
try
{
// ATTENTION: NEVER CALL ONE OF THE GETTERS OR SETTERS IN HERE!
// Aquire semaphore
mSemaphore.acquire();
// Get editor, clear editor and save new values
SharedPreferences.Editor editor = mPreferences.edit();
editor.clear();
// PackageList
editor.putInt(PACKAGEORDER + "size", mPackageOrder.size());
for (Integer i = 0; i < mPackageOrder.size(); i++)
{
String actKey = PACKAGEORDER + i.toString();
editor.remove(actKey);
editor.putString(actKey, mPackageOrder.get(i));
}
// BackgroundObserverEnabled
editor.putBoolean("prefHideLeftBarInAppOverview", mHideLeftBarInAppOverview);
// ShowBackgroundForAppNames
editor.putBoolean("prefShowBackgroundForAppNames", mShowBackgroundForAppNames);
// Update seen
editor.putBoolean("prefHaveUpdateSeen", mHaveUpdateSeen);
// Auto select first icon
editor.putBoolean("prefAutoSelectFirstIcon", mAutoSelectFirstIcon);
// Hidden apps list
editor.putStringSet("prefHiddenApps", mHiddenAppsList);
// Show sys apps
editor.putBoolean("prefShowSysApps", mShowSystemApps);
// Kodi update policy
editor.putString("prefKodiUpdatePolicy", mKodiUpdatePolicy);
// Lang
editor.putString("prefLanguage", mLanguage);
// App icon size
editor.putString("prefAppIconSize", mAppIconSize.toString());
editor.commit();
}
catch(Exception e)
{
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
String errorReason = errors.toString();
Log.d(SettingsProvider.class.getName(), "Exception while reading settings: \n" + errorReason);
}
mSemaphore.release();
}
}
@@ -0,0 +1,388 @@
package com.sidequest.launcher.tools;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.media.ThumbnailUtils;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;
import android.provider.Settings;
import android.util.Log;
import android.util.TypedValue;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
import com.sidequest.launcher.R;
/**
* Tools class to provide some additional infos
*/
public class Tools
{
// Fallback-value if timeout-value is not found
private static final int FALLBACK_SCREEN_TIMEOUT_VALUE = 30000;
// Path of the backup-file
private static final String EXPORT_FILE_PATH_NAME = new File(Environment.getExternalStorageDirectory(), "AppStarterBackup.zip").getAbsolutePath();
/**
* Restarts the current application
*
* @param c
*/
public static void doRestart(Context c)
{
try
{
//check if the context is given
if (c != null)
{
//fetch the packagemanager so we can get the default launch activity
// (you can replace this intent with any other activity if you want
PackageManager pm = c.getPackageManager();
//check if we got the PackageManager
if (pm != null)
{
//create the intent with the default start activity for your application
Intent mStartActivity = pm.getLaunchIntentForPackage(c.getPackageName());
if (mStartActivity != null)
{
mStartActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//create a pending intent so the application is restarted after System.exit(0) was called.
// We use an AlarmManager to call this intent in 100ms
int mPendingIntentId = 223344;
PendingIntent mPendingIntent = PendingIntent.getActivity(c, mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager mgr = (AlarmManager) c.getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent);
//kill the application
System.exit(0);
} else
{
Log.e("AppRestarter", "Was not able to restart application, mStartActivity null");
}
} else
{
Log.e("AppRestarter", "Was not able to restart application, PM null");
}
} else
{
Log.e("AppRestarter", "Was not able to restart application, Context null");
}
}
catch (Exception ex)
{
Log.e("AppRestarter", "Was not able to restart application");
}
}
public static long getSleepModeTimeout(Context c)
{
long currentTimeout = Settings.System.getLong(c.getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, FALLBACK_SCREEN_TIMEOUT_VALUE);
Log.d("SLEEPMODE", "CurrentSleepModeTime: " + currentTimeout);
return currentTimeout;
}
public static void setSleepModeTimeout(Context c, long valueInMs)
{
Settings.System.putInt(c.getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, (int) valueInMs);
}
public static String formatInterval(final long ms)
{
long millis = ms % 1000;
long x = ms / 1000;
long seconds = x % 60;
x /= 60;
long minutes = x % 60;
x /= 60;
long hours = x % 24;
x /= 24;
long days = x;
return String.format("%dd %02dh %02dm %02ds", days, hours, minutes, seconds, millis);
}
/**
* @param c context
* @return active ip address
*/
public static String getActiveIpAddress(Context c, String defValue)
{
try
{
String retVal = "";
try
{
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); )
{
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); )
{
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress())
{
if (!retVal.equals(""))
{
retVal += ", ";
}
// retVal += Formatter.formatIpAddress(inetAddress.hashCode());
retVal += inetAddress.getHostAddress().toString();
}
}
}
}
catch (SocketException ex)
{
}
if (retVal == null || retVal.equals(""))
{
retVal = defValue;
}
ConnectivityManager connectivityManager = (ConnectivityManager) c.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
String subType = activeNetworkInfo.getSubtypeName();
if (subType != null && !subType.equals(""))
{
subType = "-" + subType;
}
retVal = activeNetworkInfo.getTypeName() + subType + ": " + retVal;
return retVal;
}
catch (Exception e)
{
return defValue;
}
}
/**
* Retrieves the wifi name
*
* @param defValue the value to be returned if info could
* not be resolved
*/
public static String getWifiSsid(Context context, String defValue)
{
try
{
WifiManager wifiMgr = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
return wifiInfo.getSSID();
}
catch (Exception ex)
{
return defValue;
}
}
/**
* @return Details about the device
*/
public static String getDeviceDetails()
{
String versionName = getProp("ro.build.version.name");
if(!versionName.equals(""))
{
versionName = "- " + versionName;
}
String retVal = String.format("%s - Android %s %s\n\t-> %s", Build.MODEL, Build.VERSION.RELEASE, versionName, Build.DISPLAY);
return retVal;
}
/**
* Makes a system call to "getprop" and returns the property
* @param propertyName name of the property like ro.build.version.name
* @return property content or empty string if not found
*/
public static String getProp(String propertyName)
{
String result = "";
if(propertyName != null && !propertyName.equals(""))
{
Process getProcess = null;
try
{
getProcess = Runtime.getRuntime().exec("getprop " + propertyName);
BufferedReader reader = new BufferedReader(new InputStreamReader(getProcess.getInputStream()));
result = reader.readLine().trim();
getProcess.destroy();
}
catch (java.io.IOException e)
{
}
}
return result;
}
/**
* Retrieves the net.hostname system property
*
* @param defValue the value to be returned if the hostname could
* not be resolved
*/
public static String getHostName(String defValue)
{
try
{
Method getString = Build.class.getDeclaredMethod("getString", String.class);
getString.setAccessible(true);
return getString.invoke(null, "net.hostname").toString();
}
catch (Exception ex)
{
return defValue;
}
}
/**
* @param c
* @param dip Value in DIP
* @return Value in Pixel
*/
public static int getPixelFromDip(Context c, int dip)
{
int retVal = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, c.getResources().getDisplayMetrics());
return retVal;
}
/**
* @param context
* @return Current version of AppStarter
*/
public static String getCurrentAppVersion(Context context)
{
return getCurrentAppVersion(context, context.getApplicationInfo().packageName);
}
/**
* @param context
* @return Current version of an app
*/
public static String getCurrentAppVersion(Context context, String app)
{
String retVal = context.getResources().getString(R.string.not_installed);
try
{
retVal = "v" + context.getPackageManager().getPackageInfo(app, 0).versionName;
}
catch (PackageManager.NameNotFoundException e)
{
}
return retVal;
}
/**
* Delete a directory recursively
*
* @param f Directory
* @throws IOException
*/
public static void deleteDirectoryRecursively(Context context, File f, Boolean onlyContent) throws IOException
{
if (f.isDirectory())
{
for (File c : f.listFiles())
{
deleteDirectoryRecursively(context, c, false);
}
}
if (!onlyContent)
{
if (!f.delete())
{
throw new IOException("Failed to delete file: " + f);
}
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + f.getAbsolutePath())));
}
}
public static String settingsExport(Context c)
{
String retVal = "Settings export failed..";
try
{
ZipDirectory.zipDirectory(c.getApplicationInfo().dataDir, EXPORT_FILE_PATH_NAME);
retVal = "Settings exported to: " + EXPORT_FILE_PATH_NAME;
}
catch(Exception e)
{
retVal += " " + e.getMessage();
}
return retVal;
}
public static String settingsImport(Context c)
{
String retVal = null;
try
{
File dataDir = new File(c.getApplicationInfo().dataDir);
ZipDirectory.unZipDirectory(new File(EXPORT_FILE_PATH_NAME), dataDir);
}
catch(Exception e)
{
retVal = "Settings import failed: " + e.getMessage();
}
return retVal;
}
/**
* Resize a bitmap to fit the new dimensions (Fit-Center)
*
* @param source
* @param fitWidth
* @param fitHeight
* @return
*/
public static Bitmap resizeBitmapToFit(Bitmap source, Integer fitWidth, Integer fitHeight)
{
return ThumbnailUtils.extractThumbnail(source, fitWidth, fitHeight);
// // Set new width and height to fit center
// int targetW = fitWidth;
// int targetH = fitHeight;
// Log.d("PHOTO", "Target-Size : " + targetW + "x" + targetH);
//
// // Get size of current bitmap
// int photoW = source.getWidth();
// int photoH = source.getHeight();
// Log.d("PHOTO", "Source-Size : " + photoW + "x" + photoH);
//
// // Create and return correct bitmap
// Matrix m = new Matrix();
// m.setRectToRect(new RectF(0, 0, photoW, photoH), new RectF(0, 0, targetW, targetH), Matrix.ScaleToFit.CENTER);
//
// Bitmap retVal = Bitmap.createBitmap(source, 0, 0, photoW, photoH, m, true);
// Log.d("PHOTO", "Cropped-Size: " + retVal.getWidth() + "x" + retVal.getHeight());
// return retVal;
}
}
@@ -0,0 +1,517 @@
package com.sidequest.launcher.tools;
import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Semaphore;
import com.sidequest.launcher.gui.UpdaterDialogHandler;
/**
* Base Updater functionality
*/
public abstract class Updater
{
/** Holds the current updater dialog handler */
public UpdaterDialogHandler DialogHandler = null;
/** Latest version of AppStarter */
protected String mLatestVersion = null;
/** Download URL of the latest APK */
protected String mApkDownloadUrl = null;
/** Indicates if process is busy */
private Boolean mIsBusy = false;
/** Update dir on external storage */
private String mDownloadFolder = "AppStarterUpdates";
/** Indicates if the download was succesful */
private Boolean mDownloadSuccessful = false;
/** Error reason */
private String mDownloadErrorReason = null;
/** Queue value of running download */
private Long mQueueValue;
/** Download manager */
private DownloadManager mDownloadManager;
/** Update semaphore */
private Semaphore mUpdateSemaphore = null;
/** Check for update listener */
private OnCheckForUpdateFinishedListener mOnCheckForUpdateFinishedListener;
/** Update progress listener */
private OnUpdateProgressListener mOnUpdateProgressListener;
/** Returns the name of the App */
public abstract String getAppName();
/** Returns the name of the App */
public abstract String getPackageName(Context context);
public abstract Boolean isVersionNewer(String oldVersion, String newVersion);
/** Update the values of the latest version and of the APK download URL for the latest version */
protected abstract void updateLatestVersionAndApkDownloadUrl() throws Exception;
/** Return the current version */
public String getCurrentVersion(Context context)
{
return Tools.getCurrentAppVersion(context, getPackageName(context));
}
/** Return the latest version */
public String getLatestVersion()
{
return mLatestVersion;
}
/** Set the check for update listener */
public void setOnCheckForUpdateFinishedListener(OnCheckForUpdateFinishedListener listener)
{
mOnCheckForUpdateFinishedListener = listener;
}
/** Set progress update listener */
public void setOnUpdateProgressListener(OnUpdateProgressListener listener)
{
mOnUpdateProgressListener = listener;
}
/**
* Compares standard version strings like "2.1", "v2.3.1.0" or "version 1.3.2"
* @param oldVersion Old version String
* @param newVersion New version String
* @return true if newVersion String is newer than oldVersion String
*/
public Boolean isVersionNewerStandardCheck(String oldVersion, String newVersion)
{
Boolean retVal = false;
try
{
List<Integer> oldVerList = getVersionList(oldVersion);
List<Integer> newVerList = getVersionList(newVersion);
if(oldVerList.size() > 0 && newVerList.size() > 0)
{
for(Integer i = 0; i < newVerList.size(); i++)
{
// If oldversion has no additional step and all
// steps before have been equal, newVersion is newer
if(i >= oldVerList.size())
{
retVal = true;
break;
}
// If newVersions current step is higher than oldversions stage,
// newVersion is newer
if(newVerList.get(i) > oldVerList.get(i))
{
retVal = true;
break;
}
// If oldVersions current step is higher than newVersions stage,
// oldVersion is newer
if(oldVerList.get(i) > newVerList.get(i))
{
break;
}
// Else versions have been equal --> no newer
// --> check next stage or finish
}
}
else if(oldVerList.size() == 0 && newVerList.size() > 0)
{
// This happens if old version is not installed / not found
// which should mean that the latest version is anyway newer
retVal = true;
}
}
catch(Exception ignore){}
return retVal;
}
/**
* Separate version string in major, minor, ..
* Most significant value first
* @param versionString Version string to be parsed
* @return List of Integers
*/
private List<Integer> getVersionList(String versionString)
{
List<Integer> retVal = new ArrayList<Integer>();
try
{
if(versionString != null && !versionString.equals(""))
{
// Delete everything that is no digit and no dot (like e.g. "v" or "version")
versionString = versionString.replaceAll("[^\\d.]", "");
// Split the remaining part by the dots
String[] parts = versionString.split("\\.");
// Now create the version list
if(parts != null && parts.length > 0)
{
for(String part : parts)
{
retVal.add(Integer.valueOf(part));
}
}
}
}
catch(Exception ignore) { }
return retVal;
}
/** Check github for update */
public void checkForUpdate(Boolean synchron)
{
Thread checkForUpdateThread = new Thread(new Runnable()
{
@Override
public void run()
{
try
{
if (mIsBusy)
{
throw new Exception("Updater is already working..");
}
mIsBusy = true;
// Reset variables
mApkDownloadUrl = null;
mLatestVersion = null;
// Call the update mechanism of the actual updater
updateLatestVersionAndApkDownloadUrl();
// Check if latest version is not null
if(mLatestVersion == null)
{
throw new Exception("Latest version not found.");
}
// Check if download url is not null
if(mApkDownloadUrl == null)
{
throw new Exception("No .apk download URL found.");
}
// If everything was fine show success-message:
fireOnCheckForUpdateFinished("Check for update finished successful, found version: " + getLatestVersion());
Log.d(AppStarterUpdater.class.getName(), "Check for update finished successful, found version: " + getLatestVersion());
}
catch (Exception e)
{
Log.d(AppStarterUpdater.class.getName(), "Update-Check-Error: " + e.getMessage());
fireOnCheckForUpdateFinished("Update-Check-Error: " + e.getMessage());
}
finally
{
mIsBusy = false;
}
}
});
checkForUpdateThread.start();
if(synchron)
{
try
{
checkForUpdateThread.join();
}
catch (InterruptedException ignore) {}
}
}
public void update(final Context context)
{
Thread updateThread = new Thread(new Runnable()
{
@Override
public void run()
{
try
{
if (mIsBusy)
{
throw new Exception("AppStarterUpdater is already working..");
}
// Check for update synchron
checkForUpdate(true);
mIsBusy = true;
// Check if update-check was successful and version is newer
String oldVersion = getCurrentVersion(context);
String latestVersion = getLatestVersion();
if (latestVersion == null || !isVersionNewer(oldVersion, latestVersion))
{
throw new Exception("No newer version found..");
}
String apkUrl = mApkDownloadUrl;
if(apkUrl == null)
{
throw new Exception("Download URL of new version not found..");
}
Log.d(AppStarterUpdater.class.getName(), "Download from URL: " + apkUrl);
fireOnUpdateProgressListener(false, 10, "Newer version found, start download..");
// Create download-dir and start download
File downloadDir = new File(Environment.getExternalStorageDirectory(), mDownloadFolder);
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + downloadDir.getAbsolutePath())));
if(downloadDir.exists() && !downloadDir.isDirectory())
{
if(!downloadDir.delete())
{
throw new Exception("Can not delete file: " + downloadDir.getAbsolutePath());
}
}
if(!downloadDir.exists() && !downloadDir.mkdir())
{
throw new Exception("Can not create download folder: " + downloadDir.getAbsolutePath());
}
else
{
Tools.deleteDirectoryRecursively(context, downloadDir, true);
}
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + downloadDir.getAbsolutePath())));
File downloadFile = new File(downloadDir, getAppName() + "-" + latestVersion + ".apk");
mDownloadSuccessful = false;
mDownloadErrorReason = null;
DownloadManager.Request localRequest = new DownloadManager.Request(Uri.parse(apkUrl));
localRequest.setDescription("Downloading " + getAppName() + " " + latestVersion);
localRequest.setTitle(getAppName() + " Update");
localRequest.allowScanningByMediaScanner();
localRequest.setNotificationVisibility(1);
Log.d(AppStarterUpdater.class.getName(), "Download to file://" + downloadFile.getAbsolutePath());
localRequest.setDestinationUri(Uri.parse("file://" + downloadFile.getAbsolutePath()));
context.registerReceiver(new BroadcastReceiver()
{
public void onReceive(Context context, Intent intent)
{
String action = intent.getAction();
Log.d(AppStarterUpdater.class.getName(), "Received intent: " + action);
if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action))
{
DownloadManager.Query query = new DownloadManager.Query();
query.setFilterById(mQueueValue);
Cursor c = mDownloadManager.query(query);
if (c.moveToFirst())
{
int columnIndex = c.getColumnIndex(DownloadManager.COLUMN_STATUS);
if (DownloadManager.STATUS_SUCCESSFUL == c.getInt(columnIndex))
{
mDownloadSuccessful = true;
}
else
{
// Try to get error reason
switch(c.getInt(c.getColumnIndex(DownloadManager.COLUMN_REASON)))
{
case DownloadManager.ERROR_CANNOT_RESUME:
mDownloadErrorReason = "ERROR_CANNOT_RESUME";
break;
case DownloadManager.ERROR_DEVICE_NOT_FOUND:
mDownloadErrorReason = "ERROR_DEVICE_NOT_FOUND";
break;
case DownloadManager.ERROR_FILE_ALREADY_EXISTS:
mDownloadErrorReason = "ERROR_FILE_ALREADY_EXISTS";
break;
case DownloadManager.ERROR_FILE_ERROR:
mDownloadErrorReason = "ERROR_FILE_ERROR";
break;
case DownloadManager.ERROR_HTTP_DATA_ERROR:
mDownloadErrorReason = "ERROR_HTTP_DATA_ERROR";
break;
case DownloadManager.ERROR_INSUFFICIENT_SPACE:
mDownloadErrorReason = "ERROR_INSUFFICIENT_SPACE";
break;
case DownloadManager.ERROR_TOO_MANY_REDIRECTS:
mDownloadErrorReason = "ERROR_TOO_MANY_REDIRECTS";
break;
case DownloadManager.ERROR_UNHANDLED_HTTP_CODE:
mDownloadErrorReason = "ERROR_UNHANDLED_HTTP_CODE";
break;
default:
mDownloadErrorReason = "ERROR_UNKNOWN";
break;
}
}
}
c.close();
}
// Unregister receiver
context.unregisterReceiver(this);
// Release semaphore in any case..
Log.d(AppStarterUpdater.class.getName(), "Release semaphore..");
mUpdateSemaphore.release();
}
}, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
Log.d(AppStarterUpdater.class.getName(), "Aquire semaphore");
mUpdateSemaphore = new Semaphore(1);
mUpdateSemaphore.acquire();
// Here the download is performed
Log.d(AppStarterUpdater.class.getName(), "Start download");
mDownloadManager = (DownloadManager)context.getSystemService(context.DOWNLOAD_SERVICE);
mQueueValue = mDownloadManager.enqueue(localRequest);
Log.d(AppStarterUpdater.class.getName(), "Aquire semaphore again");
int lastPercentage = 0;
while(!mUpdateSemaphore.tryAcquire())
{
DownloadManager.Query q = new DownloadManager.Query();
q.setFilterById(mQueueValue);
Cursor cursor = mDownloadManager.query(q);
int percentage = 0;
if(cursor.moveToFirst())
{
int bytes_downloaded = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR));
int bytes_total = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_TOTAL_SIZE_BYTES));
percentage = (int)Math.round((((double)bytes_downloaded / (double)bytes_total) * 100.0) * 8.0/10.0);
if(percentage < 0) percentage = 0;
if(percentage > 100) percentage = 100;
}
cursor.close();
if(percentage > lastPercentage)
{
lastPercentage = percentage;
fireOnUpdateProgressListener(false, 10 + percentage, "Download in progress..");
}
Thread.sleep(500);
}
mUpdateSemaphore.release();
mUpdateSemaphore = null;
Log.d(AppStarterUpdater.class.getName(), "Download finished");
if(!mDownloadSuccessful)
{
String reason = "";
if(mDownloadErrorReason != null)
{
reason = " Reason: " + mDownloadErrorReason;
}
throw new Exception("Download failed.." + reason);
}
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + downloadFile.getAbsolutePath())));
fireOnUpdateProgressListener(false, 80, "Download finished, start installation..");
Intent installIntent = new Intent(Intent.ACTION_VIEW);
installIntent.setDataAndType(Uri.parse("file://" + downloadFile.getAbsolutePath()), "application/vnd.android.package-archive");
installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(installIntent);
fireOnUpdateProgressListener(false, 100, "Successfully initiated update..");
}
catch(Exception e)
{
Log.d(AppStarterUpdater.class.getName(), "UpdateError: " + e.getMessage());
fireOnUpdateProgressListener(true, 100, e.getMessage());
}
finally
{
mIsBusy = false;
}
}
});
updateThread.start();
}
/** Check for update */
public void checkForUpdate()
{
checkForUpdate(false);
}
/**
* Fire update progress
* @param percent Percentage
* @param message Message
*/
protected void fireOnUpdateProgressListener(final Boolean isError, final Integer percent, final String message)
{
Thread fireThread = new Thread(new Runnable()
{
@Override
public void run()
{
if(mOnUpdateProgressListener != null)
{
mOnUpdateProgressListener.onUpdateProgress(isError, percent, message);
}
}
});
fireThread.start();
}
/**
* Fire check for update finished message
* @param message Message to fire
*/
protected void fireOnCheckForUpdateFinished(final String message)
{
Thread fireThread = new Thread(new Runnable()
{
@Override
public void run()
{
if(mOnCheckForUpdateFinishedListener != null)
{
mOnCheckForUpdateFinishedListener.onCheckForUpdateFinished(message);
}
}
});
fireThread.start();
}
/**
* Interface for progress messages of update check
*/
public interface OnCheckForUpdateFinishedListener
{
public void onCheckForUpdateFinished(String message);
}
/**
* Interface for progress messages of performing an update
*/
public interface OnUpdateProgressListener
{
public void onUpdateProgress(Boolean isError, Integer percent, String message);
}
}
@@ -0,0 +1,170 @@
package com.sidequest.launcher.tools;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
public class ZipDirectory
{
public static void zipDirectory(String directoryPath, String zipFileNamePath) throws IOException
{
File directoryToZip = new File(directoryPath);
File zipFile = new File(zipFileNamePath);
File zipFilePath = zipFile.getParentFile();
if (!zipFilePath.exists())
{
zipFilePath.mkdirs();
}
if (zipFile.exists())
{
zipFile.delete();
}
List<File> fileList = new ArrayList<File>();
getAllFiles(directoryToZip, fileList);
writeZipFile(directoryToZip, fileList, zipFile);
}
/**
* Extract a zip file to the given destination folder.
* @param file zip file to extract
* @param destination destinatin folder
*/
public static void unZipDirectory(File file, File destination) throws IOException
{
ZipInputStream in = null;
OutputStream out = null;
try
{
// Open the ZIP file
in = new ZipInputStream(new FileInputStream(file));
ZipEntry entry = null;
while ((entry = in.getNextEntry()) != null)
{
String outFilename = entry.getName();
// Open the output file
if (entry.isDirectory())
{
new File(destination, outFilename).mkdirs();
}
else
{
File outputFile = new File(destination, outFilename);
File outputFileFolder = outputFile.getParentFile();
if(!outputFileFolder.exists())
{
outputFileFolder.mkdirs();
}
if(outputFile.exists())
{
outputFile.delete();
}
out = new FileOutputStream(outputFile);
// Transfer bytes from the ZIP file to the output file
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0)
{
out.write(buf, 0, len);
}
// Close the stream
out.close();
}
}
}
finally
{
// Close the stream
if (in != null)
{
in.close();
}
if (out != null)
{
out.close();
}
}
}
private static void getAllFiles(File dir, List<File> fileList)
{
File[] files = dir.listFiles();
for (File file : files)
{
fileList.add(file);
if (file.isDirectory())
{
getAllFiles(file, fileList);
}
}
}
private static void writeZipFile(File directoryToZip, List<File> fileList, File zipFile)
{
try
{
FileOutputStream fos = new FileOutputStream(zipFile);
ZipOutputStream zos = new ZipOutputStream(fos);
for (File file : fileList)
{
if (file.exists() && !file.isDirectory())
{ // we only zip files, not directories
addToZip(directoryToZip, file, zos);
}
}
zos.close();
fos.close();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
private static void addToZip(File directoryToZip, File file, ZipOutputStream zos) throws FileNotFoundException, IOException
{
FileInputStream fis = new FileInputStream(file);
// we want the zipEntry's path to be a relative path that is relative
// to the directory being zipped, so chop off the rest of the path
String zipFilePath = file.getCanonicalPath().substring(directoryToZip.getCanonicalPath().length() + 1,
file.getCanonicalPath().length());
System.out.println("Writing '" + zipFilePath + "' to zip file");
ZipEntry zipEntry = new ZipEntry(zipFilePath);
zos.putNextEntry(zipEntry);
byte[] bytes = new byte[1024];
int length;
while ((length = fis.read(bytes)) >= 0)
{
zos.write(bytes, 0, length);
}
zos.closeEntry();
fis.close();
}
}
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This one is from center-middle grow to full -->
<scale
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale="0.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:fillAfter="false"
android:startOffset="0"
android:duration="200"
android:pivotX = "50%"
android:pivotY = "50%"
/>
<!-- This one is from top middle to center
<scale
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale="0.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:fillAfter="false"
android:startOffset="200"
android:duration="200"
android:pivotX = "50%"
android:pivotY = "-90%"
/>
<translate
android:fromYDelta="50%"
android:toYDelta="0"
android:startOffset="200"
android:duration="200"
/>
-->
<!-- This one is from bottom to top slide-up
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="100%"
android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="0" />
-->
</set>
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This one is from center-middle grow to full -->
<scale
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale="1.0"
android:toXScale="0.0"
android:fromYScale="1.0"
android:toYScale="0.0"
android:fillAfter="false"
android:startOffset="0"
android:duration="200"
android:pivotX = "50%"
android:pivotY = "50%"
/>
<!-- This one is from top middle to center
<scale
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale="1.0"
android:toXScale="0.0"
android:fromYScale="1.0"
android:toYScale="0.0"
android:fillAfter="false"
android:duration="200"
android:pivotX = "50%"
android:pivotY = "-90%"
/>
<translate
android:fromYDelta="0"
android:toYDelta="50%"
android:duration="200"
/>
-->
<!-- This one is from top to bottom slide-down
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="0%p"
android:interpolator="@android:anim/accelerate_interpolator"
android:toYDelta="100%p" />
-->
</set>
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!--
<item android:state_selected="true">
<shape>
<solid android:color="#00000000"/>
</shape>
</item>
<item android:state_focused="true">
<shape>
<solid android:color="#00000000"/>
</shape>
</item>
<item android:state_pressed="true" android:color="#00000000">
<shape>
<solid android:color="#00000000"/>
</shape>
</item>
-->
<item>
<shape>
<solid android:color="@color/semitransparentbackground_medium"/>
<corners android:radius="3dp"/>
<padding android:left="3dp" android:top="0dp" android:right="3dp" android:bottom="0dp" />
</shape>
</item>
</selector>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="true">
<shape android:shape="rectangle">
<stroke android:width="2dp" android:color="@color/appselectorhighlight" />
<solid android:color="#64ffce55" />
<!--
<gradient android:startColor="#DD000000" android:endColor="#DDffce55" android:angle="225"/>
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp"/> -->
</shape>
</item>
<item android:state_pressed="true">
<shape >
<solid android:color="@color/appselectorhighlight" />
</shape>
</item>
<item android:state_pressed="false">
<shape>
<solid android:color="@android:color/transparent" />
</shape>
</item>
</selector>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="25dp" />
<solid android:color="@color/semitransparentbackground_dark" />
<stroke
android:width="5dip"
android:color="#b9f6f6f6" />
</shape>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false">
<shape>
<solid android:color="@android:color/transparent" />
</shape>
</item>
<item android:state_focused="true">
<shape android:shape="rectangle">
<stroke android:width="2dp" android:color="@color/appselectorhighlight" />
<solid android:color="#64ffce55" />
<!--
<gradient android:startColor="#DD000000" android:endColor="#DDffce55" android:angle="225"/>
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp"/> -->
</shape>
</item>
<item android:state_pressed="true">
<shape >
<solid android:color="@color/appselectorhighlight" />
</shape>
</item>
</selector>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="25dp" />
<solid android:color="#CC000000" />
<stroke
android:width="5dip"
android:color="#b9f6f6f6" />
</shape>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="true">
<shape>
<solid android:color="#00000000" />
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="#00000000" />
</shape>
</item>
<item android:state_pressed="false">
<shape>
<solid android:color="#00000000" />
</shape>
</item>
</selector>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="#ffffce55" />
<item android:state_focused="true" android:color="#ffffce55" />
<item android:state_pressed="true" android:color="#ffffce55" />
<item android:color="#FFFFFF" />
</selector>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:startColor="#6bb1b1b1"
android:endColor="#831e1e1e"
android:type="radial"
android:centerX="50%"
android:centerY="50%"
android:gradientRadius="1300" />
<!--
<gradient
android:startColor="#6bcdcdcd"
android:endColor="#6b636363"
android:type="radial"
android:centerX="@dimen/bg_grad_center_x"
android:centerY="@dimen/bg_grad_center_y"
android:gradientRadius="@dimen/bg_grad_size" />
-->
</shape>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:theme="@style/AppTheme"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="@dimen/applisting_itemsize"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:gravity="center"
android:layout_weight="1"
android:scrollbarStyle="outsideOverlay"
tools:context=".gui.MainActivity"
android:listSelector="@drawable/appselector"
android:horizontalSpacing="15dp"
android:verticalSpacing="20dp"/>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout"
android:orientation="vertical"
android:layout_width="@dimen/applisting_itemsize"
android:layout_height="@dimen/applisting_itemsize"
android:gravity="center"
android:padding="10dp">
<ImageView
android:id="@+id/imageLabel"
android:scaleType="fitCenter"
android:src="@android:drawable/ic_menu_gallery"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:contentDescription="@string/AppName"/>
<TextView
android:id="@+id/textLabel"
android:singleLine="true"
android:textSize="16sp"
android:text="@string/AppName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"/>
</LinearLayout>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout"
android:orientation="vertical"
android:layout_width="@dimen/applisting_itemsize"
android:layout_height="@dimen/applisting_itemsize"
android:gravity="center"
android:padding="10dp">
<ImageView
android:id="@+id/imageLabel"
android:scaleType="fitCenter"
android:src="@android:drawable/ic_menu_gallery"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:contentDescription="@string/AppName"/>
<TextView
android:id="@+id/textLabel"
android:singleLine="true"
android:textSize="16sp"
android:text="@string/AppName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="2dp"
android:textColor="#FFFFFF"
android:background="@drawable/appdrawergriditembackground"/>
</LinearLayout>
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/semitransparentbackground_light">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="20dp"
android:background="@drawable/appsettingsbackground">
<TextView
android:id="@+id/title"
android:text="Settings:"
android:textStyle="bold"
android:textSize="@dimen/abc_text_size_large_material"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="@dimen/appsettingboxsize"
android:layout_gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="@+id/appIcon"
android:scaleType="fitCenter"
android:src="@android:drawable/ic_menu_gallery"
android:layout_width="@dimen/appsettingboxsize"
android:layout_height="@dimen/appsettingboxsize"
android:padding="15dp"
android:focusable="false"
android:contentDescription="@string/AppName"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="@dimen/appsettingsoptionpadding"
android:layout_marginRight="@dimen/appsettingsoptionpadding"
android:background="@color/whitedivider"
android:focusable="false" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/appSort"
android:clickable="true"
android:focusable="true"
android:background="@drawable/appsettingsselector"
android:layout_width="@dimen/appsettingboxsize_small"
android:layout_height="@dimen/appsettingboxsize_small"
android:layout_gravity="center"
android:padding="10dp"
android:orientation="vertical">
<ImageView
android:scaleType="fitCenter"
android:src="@mipmap/app_sort"
android:layout_width="@dimen/settingsiconsize"
android:layout_height="@dimen/settingsiconsize"
android:layout_gravity="center"
android:focusable="false"
android:contentDescription="@string/AppName"/>
<TextView
android:text="@string/appsettingssort"
android:gravity="center|bottom"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="@dimen/appsettingsoptionpadding"
android:background="@color/whitedivider"
android:focusable="false" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/appSettings"
android:clickable="true"
android:focusable="true"
android:selectable="true"
android:background="@drawable/appsettingsselector"
android:layout_width="@dimen/appsettingboxsize_small"
android:layout_height="@dimen/appsettingboxsize_small"
android:layout_gravity="center"
android:padding="10dp"
android:orientation="vertical">
<ImageView
android:scaleType="fitCenter"
android:src="@mipmap/app_settings"
android:layout_width="@dimen/settingsiconsize"
android:layout_height="@dimen/settingsiconsize"
android:layout_gravity="center"
android:focusable="false"
android:contentDescription="@string/AppName"/>
<TextView
android:text="@string/appsettings_settings"
android:gravity="center|bottom"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="@dimen/appsettingsoptionpadding"
android:layout_marginRight="@dimen/appsettingsoptionpadding"
android:background="@color/whitedivider"
android:focusable="false" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/notfound"
android:textSize="@dimen/textsizeinfotitle"
android:textColor="#FFFFFF"
android:id="@+id/title"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/notfound"
android:textSize="@dimen/textsizeinfo"
android:id="@+id/currentVersion"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/notfound"
android:textSize="@dimen/textsizeinfo"
android:id="@+id/latestVersion"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/update_checkfor"
android:id="@+id/buttonCheckForUpdate"/>
<Button
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/update"
android:id="@+id/buttonUpdate"/>
</LinearLayout>
</LinearLayout>
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/semitransparentbackground_light">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="20dp"
android:background="@drawable/infooverlaybackground">
<TextView
android:id="@+id/title"
android:text="Title"
android:textStyle="bold"
android:textSize="@dimen/abc_text_size_large_material"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginTop="10dp"
android:layout_width="500dp"
android:layout_height="200dp"
android:layout_gravity="center"
android:orientation="horizontal" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:fillViewport="true">
<TextView
android:id="@+id/summary"
android:text="Summary"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.0"/>
</ScrollView>
</LinearLayout>
</LinearLayout>
</FrameLayout>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/textLabel"
android:singleLine="true"
android:textSize="20sp"
android:textColor="@drawable/itemtextselector"
android:text="@string/AppName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:gravity="right"/>
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/mainbackground"
android:id="@+id/linearLayoutMain">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/linearLayoutSemiTransparentBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageLabel"
android:scaleType="fitCenter"
android:src="@mipmap/appstarter_logo_only_white_middle"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="3dp"
android:layout_marginRight="7dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/AppName"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="13dp"
android:textSize="17dp"
android:textColor="#FFFFFF"
android:text="@string/AppName"
android:autoText="true"
android:focusable="false"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginRight="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textViewClock"
android:layout_gravity="right"
android:textSize="18dp"
android:textColor="#FFFFFF"
android:text="00:00"
android:autoText="true"
android:focusable="false"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textViewDate"
android:layout_gravity="right"
android:textSize="13dp"
android:textColor="#FFFFFF"
android:text="Mo, 1. Jan 2015"
android:autoText="true"
android:focusable="false"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/leftbar"
android:orientation="vertical"
android:layout_width="@dimen/leftbarwidth"
android:layout_height="match_parent"
android:paddingRight="20dp"
android:gravity="center">
<ListView
android:id="@+id/listView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="90dp"
android:layout_weight="1"
android:dividerHeight="0dp"
android:divider="#00000000"
android:listSelector="@drawable/itemselector" />
</LinearLayout>
<FrameLayout
android:id="@+id/item_detail_container"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingTop="6dp"
android:paddingBottom="20dp"
android:paddingRight="20dp"
android:paddingLeft="20dp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/listView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:dividerHeight="0dp"
android:divider="#00000000"
android:listSelector="@drawable/itemselector" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:text="@string/about_appstarter"
android:textSize="@dimen/textsizeinfo" />
</LinearLayout>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

@@ -0,0 +1,115 @@
<resources>
<!-- String resources (non translatable) -->
<string name="AppName">AppStarter</string>
<!-- To be translated -->
<string name="AmazonHome">FireTV 主界面</string>
<string name="MoveAppAndClickToDrop">现在移动应用程序,再次点击放置应用到新位置 \n(按返回键取消)</string>
<string name="MoveAppAndClickToDropWhenStartedByMenu">现在移动应用程序,再次点击放置应用到新位置 \n(按返回键取消)</string>
<string name="loading">加载中</string>
<string name="background_observation">后台监视</string>
<string name="enable_background_observation_desc">启用后台监视 Home 键和启动事件。</string>
<string name="enable_background_observation_title">启用后台监视。</string>
<string name="iptitle">IP 地址</string>
<string name="hostnametitle">主机名</string>
<string name="notfound">未找到…</string>
<string name="appstarterversiontitle">AppStarter 版本</string>
<string name="startup_app_desc">在 FireTV 启动时自动启动的应用</string>
<string name="startup_app_title">自启动应用</string>
<string name="singleclick_app_desc">在单击 Home 键时启动的应用。</string>
<string name="singleclick_app_title">Home 单击启动应用</string>
<string name="doubleclick_app_desc">在双击 Home 键时启动的应用。</string>
<string name="doubleclick_app_title">Home 双击启动应用</string>
<string name="showsysapps_desc">在应用列表中也显示系统应用程序。</string>
<string name="showsysapps_title">显示系统应用</string>
<string name="hiddenapps_desc">在程序列表中不显示的应用程序。</string>
<string name="hiddenapps_title">隐藏应用</string>
<string name="applist_settings">应用列表设置</string>
<string name="settings_timings">监视计时</string>
<string name="doubleclick_interval_desc">设置等待第二次点击的毫秒数(100到1000之间)</string>
<string name="doubleclick_interval_title">双击间隔</string>
<string name="is_invalid_number">对当前设置无效!</string>
<string name="update_currentversion">当前 AppStarter 版本</string>
<string name="update_currentversion_kodi">当前 Kodi 版本</string>
<string name="install">安装</string>
<string name="serverVersion">AppStarter 最新版本</string>
<string name="serverVersion_kodi">Kodi 最新版本</string>
<string name="update_checkfor">检查更新</string>
<string name="update">更新到最新版本</string>
<string name="update_hitcheckfor">点击检查更新来查找最新版本。</string>
<string name="autoselectfirsticon_desc">当切换到应用抽屉时自动选择第一个图标(应用列表)。</string>
<string name="autoselectfirsricon_title">自动选择第一个图标(应用列表)</string>
<string name="about_appstarter">AppStarter 是亚马逊 FireTV 的一个无需 Root 的 Launcher 替代品/应用抽屉:\n\n访问XDA-Developers上的讨论组:\nhttp://forum.xda-developers.com/fire-tv/themes-apps/app-root-home-launcher-replacement-app-t3118135\n\nAppStarter是开源软件,访问GitHub上的项目:\nhttps://github.com/sphinx02/AppStarter</string>
<string name="jumpbackwatchdogtime_desc">点击操作时,AppStarter 防止亚马逊home launcher切换到前台的时间(毫秒,0到10000之间)。设置为0禁用此功能。</string>
<string name="jumpbackwatchdogtime_title">返回看门狗时间</string>
<string name="AmazonSettings">FireTV 设置</string>
<string name="leftbar_allapps">应用</string>
<string name="leftbar_infos">系统</string>
<string name="leftbar_updates">更新</string>
<string name="leftbar_install">安装</string>
<string name="leftbar_settings">设置</string>
<string name="appsettingssort">移动</string>
<string name="appsettings_settings">应用设置</string>
<string name="language_settings">语言设置</string>
<string name="language_summary">手动设置语言。</string>
<string name="language_title">语言</string>
<string name="update_checkfortitle">检查更新</string>
<string name="update_checkfordesc">等待从GitHub检查最新版本。</string>
<string name="update_checkformessage">检查更新。</string>
<string name="update_foundnew">发现新版本 - 现在更新!</string>
<string name="update_foundnotnew">你已经安装了最新版本!</string>
<string name="power_reboot">重启</string>
<string name="wifissidtitle">WiFi / WLAN 名称(SSID)</string>
<string name="layout_settings">布局设置</string>
<string name="wallpaper_summary">给 AppStarter 设置自定义背景图片/壁纸</string>
<string name="wallpaper_title">壁纸 / 背景图片</string>
<string name="remove_wallpaper">移除壁纸</string>
<string name="select_wallpaper">选择壁纸</string>
<string name="power_sleep">睡眠</string>
<string name="system_informative">系统信息</string>
<string name="system_settings">系统设置</string>
<string name="system_sleeptime_edit_summary">设备多少分钟无动作后进入睡眠。</string>
<string name="system_sleeptime_edit_title">睡眠超时时间</string>
<string name="gotosleep_summary">注意:此功能已经被从 AppStarter 移除!长按 Home 键寻找马上进入睡眠的选项。</string>
<string name="gotosleep_title">进入睡眠</string>
<string name="system_restart_summary">注意:如果你点击此处,设备将会马上重启!</string>
<string name="system_restart_title">重启</string>
<string name="gotosleep_waitforsleep">请等待,设备将会在几秒后进入睡眠…</string>
<string name="gotosleep_waitforsleep_title">进入睡眠模式…</string>
<string name="sleeptime_limit">只接受在 %1$d 和 %2$d 分钟之间的数值!</string>
<string name="gotosleep_cancel">取消进入睡眠…</string>
<string name="devicedetailstitle">设备详细信息</string>
<string name="appicon_size_title">应用图标大小</string>
<string name="appicon_size_summary">主应用抽屉中的应用图标大小(数值0到200之间,单位DPI)。设置为0使用默认的图标大小。</string>
<string name="importExport">导入 / 导出</string>
<string name="importexport_export_summary">导出当前 AppStarter 设置到ZIP文件。</string>
<string name="importexport_export_title">导出</string>
<string name="importexport_import_summary">从ZIP文件中导入 AppStarter 设置。请注意只导入受信任的 ZIP 文件!</string>
<string name="importexport_import_title">导入</string>
<string name="deviceuptime">运行时间</string>
<string name="uptimedesc">设备已经运行了 %1$s(启动时间:%2$s)</string>
<string name="clearpreviousinstance_desc">如果选中此选项,该应用之前所有的运行实例将会被清除,重新启动一个新的进程(不会恢复之前状态)。</string>
<string name="clearpreviousinstance_singleclick_title">单击应用程序:清除之前运行实例</string>
<string name="clearpreviousinstance_doubleclick_title">双击应用程序:清除之前运行实例</string>
<string name="background_observation_viaadb_title">通过 ADB 检查 Home 键</string>
<string name="background_observation_viaadb_desc">使用 ADB 检查 Home 键点击。此方法更精确,但只在ADB运行和启用的状态下有效(在设置中禁用/启用)。</string>
<string name="system_restart_summary_removed">注意:该功能已经从AppStarter中被移除,请同时按下\"确定/选择\" + \"播放\"按钮来重启FireTV.</string>
<string name="open_adb_settings_title">打开ADB设置</string>
<string name="open_adb_settings_summary">这是打开ADB设置的快捷方式。</string>
<string name="observation_via_adb_title">通过ADB监视</string>
<string name="observation_via_adb_summary">你已经选择通过ADB监视Home键。\n\n使用该选项请注意必须启用ADB。如果已经安装FireOS5 (Android v5.1),你必须确保此时没有其他设备通过ADB链接。如果你想使用类似adbFire, Amazon FireTV Utility App, Apps2Fire的工具,你应该在尝试连接前先禁用AppStarter的ADB监视并禁用/启用ADB。\n\n如果你想重新在AppStarter中启用ADB监视,确保你先禁用/启用ADB(下面有进入ADB设置的快捷方式)。</string>
<string name="observation_without_adb_title">不通过ADB监视</string>
<string name="observation_without_adb_summary">你已经选择新的Home键监视方式(不通过ADB)。\n\此监视方式仅在亚马逊FireTV首页起效。这意味着如果你在其他应用中(比如Kodi),你必须先点击Home键回到亚马逊FireTV首页,然后再单击或者双击Home键。\n\n实际上这意味着在其他应用中你需要多按一次Home键。例如在Kodi中,你需要双击Home键来完成单击操作,或者三击Home键来完成双击操作。\n\n对于这种奇怪的行为我们表示抱歉,由于Android的技术限制,在不使用ADB的情况下暂时没有其他解决办法。</string>
<string name="fallback_to_nonadb_title">自动退回不使用ADB的监视方式</string>
<string name="fallback_to_nonadb_desc">如果选择了此选项,并且ADB监视失败了3次,Home键监视方式将会启动切换到不使用ADB的监视方式。</string>
<string name="adb_fail_auto_observation_change">切换到不使用ADB的监视\n\nADB监视已经失败了超过3次。Home键监视方式已经切换到不使用ADB的监视方式。你可以在AppStarter设置中更改此行为。</string>
<string name="hideleftbarinappoverview_title">在应用抽屉中隐藏左侧导航栏</string>
<string name="hideleftbarinappoverview_desc">在主页面(应用抽屉)时左侧导航栏会被隐藏</string>
<string name="showbackgroundforappnames_title">应用名称背景 (应用抽屉)</string>
<string name="showbackgroundforappnames_desc">在应用抽屉中的应用名称显示背景。这会在使用背景图片的情况下让应用名称变得易读。</string>
<string name="feature_only_availabe_fireos3_and_older">该功能仅在FireOS 3或更高版本中有效…</string>
<string name="update_settings">更新设置</string>
<string name="kodi_update_policy_desc">决定安装哪些Kodi更新. 如果你选择 \"Nightly\", 检查更新版本将会无效(你可以始终安装当前版本)。\n注意:如果需要降级,你必须手动删除Kodi!</string>
<string name="kodi_update_policy_title">Kodi更新策略</string>
<string name="not_installed">not installed</string>
</resources>
@@ -0,0 +1,115 @@
<resources>
<!-- String resources (non translatable) -->
<string name="AppName">AppStarter</string>
<!-- To be translated -->
<string name="AmazonHome">FireTV Home</string>
<string name="MoveAppAndClickToDrop">Verschiebe die App nun und klicke erneut \n(ZURÜCK um abzubrechen)</string>
<string name="MoveAppAndClickToDropWhenStartedByMenu">Verschiebe die App nun und klicke erneut \n(ZURÜCK um abzubrechen)</string>
<string name="loading">läd..</string>
<string name="background_observation">Hintergrund Überwachung</string>
<string name="enable_background_observation_desc">Aktiviere Hintergrund-Überwachung des home-button und des startup-events.</string>
<string name="enable_background_observation_title">Aktiviere Hintergrund Überwachung</string>
<string name="iptitle">IP Adresse</string>
<string name="hostnametitle">Hostname</string>
<string name="notfound">nicht gefunden..</string>
<string name="appstarterversiontitle">AppStarter Version</string>
<string name="startup_app_desc">App nach dem Einschalten des FireTV gestartet wird.</string>
<string name="startup_app_title">Startup App</string>
<string name="singleclick_app_desc">App die bei einem Home-Button Einzel-Klick gestartet wird.</string>
<string name="singleclick_app_title">Home-Button Einzel-Klick App</string>
<string name="doubleclick_app_desc">App die bei einem Home-Button Doppel-Klick gestartet wird.</string>
<string name="doubleclick_app_title">Home-Button Doppel-Klick App</string>
<string name="showsysapps_desc">Zeige auch System-Apps in der App-Liste.</string>
<string name="showsysapps_title">Zeige System-Apps</string>
<string name="hiddenapps_desc">Apps die ausgeblendet werden sollen.</string>
<string name="hiddenapps_title">Versteckte Apps</string>
<string name="applist_settings">App-Listen Einstellungen</string>
<string name="settings_timings">Überwachungs-Timings</string>
<string name="doubleclick_interval_desc">Zeit in Millisekunden (zwischen 100 - 1000) in der auf den zweiten Klick gewartet wird</string>
<string name="doubleclick_interval_title">Doppel-Klick Intervall</string>
<string name="is_invalid_number">ist nicht erlaubt für diese Einstellung!</string>
<string name="update_currentversion">Aktuelle AppStarter Version</string>
<string name="serverVersion">Neueste AppStarter Version</string>
<string name="update_checkfor">Auf Update prüfen</string>
<string name="update">Updaten</string>
<string name="update_hitcheckfor">Klicke auf Update prüfen.</string>
<string name="autoselectfirsticon_desc">Automatisch die erste App auswählen in der App-Übersicht (Alle Apps).</string>
<string name="autoselectfirsricon_title">Erste-App Auto-Auswahl (App-Übersicht)</string>
<string name="about_appstarter">AppStarter is a Non-Root Launcher Replacement / App-Drawer for Amazon FireTV:\n\nVisit discussion on XDA-Developers:\nhttp://forum.xda-developers.com/fire-tv/themes-apps/app-root-home-launcher-replacement-app-t3118135\n\nAppStarter is Open-Source, visit project on GitHub:\nhttps://github.com/sphinx02/AppStarter</string>
<string name="jumpbackwatchdogtime_desc">Die Zeit in Millisekunden (zwischen 0 - 10000) in der AppStarter verhindert, dass der FireTV Home-Launcher sich in den Vordergrund drängt wenn von AppStarter Klick-Aktionen durchgeführt wurden. Auf 0 setzen um zu deaktiviern.</string>
<string name="jumpbackwatchdogtime_title">Jump Back Watchdog Zeit</string>
<string name="AmazonSettings">FireTV Einstellungen</string>
<string name="leftbar_allapps">Apps</string>
<string name="leftbar_infos">System</string>
<string name="leftbar_updates">Updates</string>
<string name="leftbar_settings">Einstellungen</string>
<string name="appsettingssort">Verschieben</string>
<string name="appsettings_settings">App Einstell..</string>
<string name="language_settings">Sprach Einstellungen</string>
<string name="language_summary">Sprache manuell einstellen</string>
<string name="language_title">Sprache</string>
<string name="update_checkfortitle">Prüfe auf Update</string>
<string name="update_checkfordesc">Warten bis auf Update geprüft wurde.</string>
<string name="update_checkformessage">Prüfe auf Update.</string>
<string name="update_foundnew">Neue Version gefunden - jetzt updaten!</string>
<string name="update_foundnotnew">Die neueste Version ist bereits installiert!</string>
<string name="power_reboot">Neustarten</string>
<string name="wifissidtitle">WiFi / WLAN Name (SSID)</string>
<string name="layout_settings">Layout Einstellungen</string>
<string name="wallpaper_summary">Wähle ein eigenes Hintergrundbild / Wallpaper für AppStarter</string>
<string name="wallpaper_title">Wallpaper / Hintergrundbild</string>
<string name="remove_wallpaper">Wallpaper entfernen</string>
<string name="select_wallpaper">Wallpaper auswählen</string>
<string name="power_sleep">Sleep</string>
<string name="system_informative">System Informationen</string>
<string name="system_settings">System Einstellungen</string>
<string name="system_sleeptime_edit_summary">Die Zeit ohne Aktivität in Minuten nach der das Gerät in den Ruhezustand geht.</string>
<string name="system_sleeptime_edit_title">Ruhezustand Timeout</string>
<string name="gotosleep_summary">ACHTUNG: Dieses Feature wurde aus AppStarter entfernt! Drücke lange auf den Home-Button um die Option anzuzeigen den FireTV direkt in den Ruhemodus zu bringen.</string>
<string name="gotosleep_title">Gehe in den Ruhezustand</string>
<string name="system_restart_summary">ACHTUNG: Klicken started das Gerät sofort neu!</string>
<string name="system_restart_title">Neustarten</string>
<string name="gotosleep_waitforsleep">Bitte warten, das Gerät geht in wenigen Sekunden in den Ruhemodus..</string>
<string name="gotosleep_waitforsleep_title">Gehe in den Ruhemodus..</string>
<string name="sleeptime_limit">Nur Werte zwischen %1$d und %2$d Minuten sind erlaubt!</string>
<string name="gotosleep_cancel">Ruhemodus abgebrochen..</string>
<string name="devicedetailstitle">Geräte Details</string>
<string name="appicon_size_title">App Icon Größe</string>
<string name="appicon_size_summary">Größe zwischen 0 und 200 (in DPI) der App-Icons im App-Drawer auf der Hauptseite. Auf 0 setzen für Default-Größe.</string>
<string name="importExport">Import / Export</string>
<string name="importexport_export_summary">Exportiere aktuelle AppStarter Einstellungen in ZIP-File.</string>
<string name="importexport_export_title">Export</string>
<string name="importexport_import_summary">Importiere AppStarter Einstellungen aus ZIP-File. Nur vertrauenswürdige ZIP-Files importieren!</string>
<string name="importexport_import_title">Import</string>
<string name="deviceuptime">Uptime</string>
<string name="uptimedesc">Das Gerät ist aktiv seit %1$s (gestartet am: %2$s)</string>
<string name="clearpreviousinstance_desc">Wenn diese Option gesetzt ist, werden alle vorherigen Instanzen der App vor dem Start gelöscht (nichts von der vorherigen Aktivität wird wiederhergestellt).</string>
<string name="clearpreviousinstance_singleclick_title">Einzel-Klick App: Sauberer Start</string>
<string name="clearpreviousinstance_doubleclick_title">Doppel-Klick App: Sauberer Start</string>
<string name="background_observation_viaadb_title">Home-Erkennung via ADB</string>
<string name="background_observation_viaadb_desc">ADB benutzen um Home-Button klicks zu erkennen. Funktioniert besser / genauer, benötigt aber korrekt aktiviertes ADB (deaktivieren + aktivieren von ADB in den Einstellungen).</string>
<string name="system_restart_summary_removed">ACHTUNG: Dieses Feature wurde aus AppStarter entfernt. Halte die \"Enter/Bestätigen\"-Taste und die \"Play\"-Taste gedrückt um den FireTV neuzustarten.</string>
<string name="open_adb_settings_title">ADB Einstellungen öffnen</string>
<string name="open_adb_settings_summary">Klicke um die ADB-Einstellungen direkt zu öffnen.</string>
<string name="observation_via_adb_title">Home-Erkennung via ADB</string>
<string name="observation_via_adb_summary">Du hast die Home-Erkennung via ADB aktiviert.\n\nFür diese Einstellung ist es wichtig, das ADB korret aktiviert ist und bleibt. Wenn du bereits FireOS5 (Android v5.1) benutzt, solltest du darauf achten, dass keine andere ADB Verbindung parallel zu AppStarter aufgebaut wird. Wenn du Tools wie z.B. adbFire, Amazon FireTV Utility App, Apps2Fire oder ähnliche benutzen möchtest, solltest du vorher die Home-Erkennung via ADB im AppStarter deaktivieren und ADB deaktiviern und aktivieren bevor du dich zum FireTV verbinden möchtest.\n\nWenn du danach die ADB Home-Erkennung erneut nutzen möchtest, deaktiviere und aktiviere ADB erneut, dass die Home-Erkennung via ADB von AppStarter wieder funktioniert (Shortcut zu den ADB Einstellungen befindet sich unter dieser Einstellung).</string>
<string name="observation_without_adb_title">Home-Erkennung ohne ADB</string>
<string name="observation_without_adb_summary">Du hast die neue Home-Erkennung ohne ADB aktiviert.\n\nDiese Home-Erkennung funktioniert leider nur, wenn du auf der originalen Amazon FireTV Home Ansicht bist. Das heißt, wenn du in einer anderen App wie z.B. Kodi bist, dann musst du den Home-Button einmal drücken um auf die Amazon FireTV Home Ansicht zu gelangen und dann kannst du wie gewohnt einen Doppel- oder Einzel-Klick auf den Home-Button machen um die gewünschte Aktion auszuführen.\n\nDas bedeutet praktisch, dass du auch einfach einen Home-Button-Klick hinzufügen kannst wenn du dich in einer anderen App befindest. Wenn du z.B. in Kodi bist, kannst du einen Doppel-Klick auf den Home-Button machen um die Single-Klick Aktion auszuführen und entsprechend einen Triple-Klick um die Doppelklick-Aktion auszuführen.\n\nDas Verhalten ist etwas seltsam, lässt sich aber leider auf Grund technischer Limitierungen von Android im Moment ohne ADB nicht anders umsetzen.</string>
<string name="fallback_to_nonadb_title">Fallback zur Home-Erkennung ohne ADB</string>
<string name="fallback_to_nonadb_desc">Wenn diese Option aktiviert ist, wird die ADB-Home-Erkennung nach 3 Fehlversuchen automatisch auf Nicht-ADB-Home-Erkennung umgestellt.</string>
<string name="adb_fail_auto_observation_change">Wechsel auf Nicht-ADB Home-Erkennung.\n\nDie Home-Erkennung mit ADB war mehr als 3 mal fehlerhaft, es wurde automatisch auf Nicht-ADB Home-Erkennung gewechselt. Dieses Verhalten lässt sich in den AppStarter Einstellungen deaktivieren.</string>
<string name="hideleftbarinappoverview_title">Linke Auswahlliste in der App-Übersicht verstecken</string>
<string name="hideleftbarinappoverview_desc">Mit dieser Option wird die Linke Auswahlliste versteckt wenn man sich in der App-Übersicht befindet.</string>
<string name="showbackgroundforappnames_title">Hintergrund für App-Namen (App-Übersicht)</string>
<string name="showbackgroundforappnames_desc">Blendet einen Hintergrund für die App-Namen ein. Dies erhöht die Lesbarkeit wenn Wallpaper benutzt werden.</string>
<string name="feature_only_availabe_fireos3_and_older">Dieses Feature ist nur in FireOS 3 und älteren Versionen verfügbar.</string>
<string name="install">Installieren</string>
<string name="leftbar_install">Installieren</string>
<string name="serverVersion_kodi">Neueste Kodi Version</string>
<string name="update_currentversion_kodi">Aktuelle Kodi Version</string>
<string name="update_settings">Update Einstellungen</string>
<string name="kodi_update_policy_desc">Entscheide welche Kodi-Versionen installiert werden sollen. Wenn du \"Nightly\" wählst, wird der Update-Check nutzlos (es ist dann immer möglich die aktuelle Version zu installieren).\nACHTUNG: Für einen downgrade der Version muss Kodi immer zuerst manuell deinstalliert werden!</string>
<string name="kodi_update_policy_title">Kodi Update Richtlinie</string>
<string name="not_installed">nicht installiert</string>
</resources>
@@ -0,0 +1,246 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- String resources (non translatable) -->
<!--Original value: AppStarter-->
<string name="AppName">AppStarter</string>
<!-- To be translated -->
<!--Original value: FireTV Home-->
<string name="AmazonHome">FireTV Home</string>
<!--Original value: Now move app and click again to drop
(Press RETURN to CANCEL)-->
<string name="MoveAppAndClickToDrop">Переместите приложение и кликните снова на новом месте\n(Нажмите Назад для Отмены)</string>
<!--Original value: Now move app and click to drop
(Press RETURN to CANCEL)-->
<string name="MoveAppAndClickToDropWhenStartedByMenu">Переместите приложение и кликните на новом месте\n(Нажмите Назад для Отмены)</string>
<!--Original value: loading-->
<string name="loading">загрузка</string>
<!--Original value: Background Observation-->
<string name="background_observation">Фоновое отслеживание</string>
<!--Original value: Enable background observation of home-button and startup-event.-->
<string name="enable_background_observation_desc">Отслеживать в фоновом режиме нажатия кнопки Домой и старт Fire TV.</string>
<!--Original value: Enable background observation.-->
<string name="enable_background_observation_title">Включить фоновое отслеживание.</string>
<!--Original value: IP Address-->
<string name="iptitle">IP адрес</string>
<!--Original value: Hostname-->
<string name="hostnametitle">Имя хоста</string>
<!--Original value: not found..-->
<string name="notfound">не найдено...</string>
<!--Original value: AppStarter Version-->
<string name="appstarterversiontitle">Версия AppStarter</string>
<!--Original value: App that is started on FireTV startup-->
<string name="startup_app_desc">Приложение, запускаемое при старте Fire TV</string>
<!--Original value: Startup Application-->
<string name="startup_app_title">Стартовое приложение</string>
<!--Original value: App that is started on home button single click.-->
<string name="singleclick_app_desc">Приложение, запускаемое одинарным кликом кнопки Домой.</string>
<!--Original value: Home Button Single Click Application-->
<string name="singleclick_app_title">Кнопка Домой - приложение по одинарному клику</string>
<!--Original value: App that is started on home button double click.-->
<string name="doubleclick_app_desc">Приложение, запускаемое двойным кликом кнопки Домой.</string>
<!--Original value: Home Button Double Click Application-->
<string name="doubleclick_app_title">Кнопка Домой - приложение по двойному клику</string>
<!--Original value: Show also system apps in app list.-->
<string name="showsysapps_desc">Показывать также системные приложения в меню Приложения.</string>
<!--Original value: Show system apps-->
<string name="showsysapps_title">Показывать системные приложения</string>
<!--Original value: Apps that shall not be shown in apps list.-->
<string name="hiddenapps_desc">Приложения, которые не будут показаны в меню Приложения.</string>
<!--Original value: Hidden Apps-->
<string name="hiddenapps_title">Скрытые Приложения</string>
<!--Original value: App Listing Settings-->
<string name="applist_settings">Настройки списка приложений / меню Приложения</string>
<!--Original value: Observer Timings-->
<string name="settings_timings">Временные задержки</string>
<!--Original value: Define the time in milliseconds (between 100 - 1000) to wait for the second click-->
<string name="doubleclick_interval_desc">Укажите время в миллисекундах (в пределах 100 - 1000) для ожидания второго клика</string>
<!--Original value: Double click interval-->
<string name="doubleclick_interval_title">Интервал двойного клика</string>
<!--Original value: is invalid for this setting!-->
<string name="is_invalid_number">некорректно для данной настройки!</string>
<!--Original value: Current AppStarter Version-->
<string name="update_currentversion">Текущая версия AppStarter</string>
<!--Original value: Current Kodi Version-->
<string name="update_currentversion_kodi">Текущая версия Kodi</string>
<!--Original value: Install-->
<string name="install">Установка</string>
<!--Original value: Latest AppStarter Version-->
<string name="serverVersion">Последняя версия AppStarter</string>
<!--Original value: Latest Kodi Version-->
<string name="serverVersion_kodi">Последняя версия Kodi</string>
<!--Original value: Check for Update-->
<string name="update_checkfor">Проверить обновление</string>
<!--Original value: Update to latest Version-->
<string name="update">Обновить до последней версии</string>
<!--Original value: Hit check for update to check for latest version.-->
<string name="update_hitcheckfor">Нажмите Проверить обновление для проверки наличия обновления.</string>
<!--Original value: Auto select the first icon when switching to the app drawer (All Apps).-->
<string name="autoselectfirsticon_desc">Авто выбор первой иконки при переходе на Рабочий стол (Все Приложения).</string>
<!--Original value: Auto select first icon (App Drawer)-->
<string name="autoselectfirsricon_title">Авто выбор первой иконки (Рабочий стол)</string>
<!--Original value: AppStarter is a Non-Root Launcher Replacement / App-Drawer for Amazon FireTV:
Visit discussion on XDA-Developers:
http://forum.xda-developers.com/fire-tv/themes-apps/app-root-home-launcher-replacement-app-t3118135
AppStarter is Open-Source, visit project on GitHub:
https://github.com/sphinx02/AppStarter-->
<string name="about_appstarter">AppStarter - замена лаунчера / рабочий стол для Amazon Fire TV (не требует root):\n\nПосетите тему на XDA-Developers:\nhttp://forum.xda-developers.com/fire-tv/themes-apps/app-root-home-launcher-replacement-app-t3118135\n\nAppStarter является Open-Source, посетите проект на GitHub:\nhttps://github.com/sphinx02/AppStarter</string>
<!--Original value: The time window in milliseconds (between 0 - 10000) in which AppStarter prevents the amazon home launcher from coming to foreground when click-actions have been performed. Set to 0 to disable.-->
<string name="jumpbackwatchdogtime_desc">Время в миллисекундах (в пределах 0 - 10000), в течение которого AppStarter предотвращает показ стартового экрана Amazon при выполнении клик-действий. Установите 0 для отключения.</string>
<!--Original value: Jump Back Watchdog Time-->
<string name="jumpbackwatchdogtime_title">Время предотвращения показа стартового экрана Amazon</string>
<!--Original value: FireTV Settings-->
<string name="AmazonSettings">Настройки Fire TV</string>
<!--Original value: Apps-->
<string name="leftbar_allapps">Приложения</string>
<!--Original value: System-->
<string name="leftbar_infos">Система</string>
<!--Original value: Updates-->
<string name="leftbar_updates">Обновление</string>
<!--Original value: Install-->
<string name="leftbar_install">Установка</string>
<!--Original value: Settings-->
<string name="leftbar_settings">Настройки</string>
<!--Original value: Move-->
<string name="appsettingssort">Перемещение</string>
<!--Original value: App Settings-->
<string name="appsettings_settings">Настройки</string>
<!--Original value: Language Settings-->
<string name="language_settings">Языковые настройки</string>
<!--Original value: Set language manually.-->
<string name="language_summary">Указать язык вручную.</string>
<!--Original value: Language-->
<string name="language_title">Язык</string>
<!--Original value: Checking for updates-->
<string name="update_checkfortitle">Проверка обновления</string>
<!--Original value: Check for latest release version.-->
<string name="update_checkfordesc">Поиск последней версии.</string>
<!--Original value: Check for update.-->
<string name="update_checkformessage">Проверяем наличие обновления.</string>
<!--Original value: Found newer Version - Update Now!-->
<string name="update_foundnew">Найдена новая версия - Обновите сейчас!</string>
<!--Original value: You have already the newest version!-->
<string name="update_foundnotnew">Вы уже используете последнюю версию!</string>
<!--Original value: Reboot-->
<string name="power_reboot">Перезагрузка</string>
<!--Original value: WiFi / WLAN Name (SSID)-->
<string name="wifissidtitle">Имя WiFi / WLAN (SSID)</string>
<!--Original value: Layout Settings-->
<string name="layout_settings">Настройки отображения</string>
<!--Original value: Set a custom background image / wallpaper for AppStarter-->
<string name="wallpaper_summary">Установите пользовательское фоновое изображение / обои для AppStarter</string>
<!--Original value: Wallpaper / Background Image-->
<string name="wallpaper_title">Обои / Фоновое изображение</string>
<!--Original value: Remove Wallpaper-->
<string name="remove_wallpaper">Удалить обои</string>
<!--Original value: Select Wallpaper-->
<string name="select_wallpaper">Выбрать обои</string>
<!--Original value: Sleep-->
<string name="power_sleep">Сон</string>
<!--Original value: System Information-->
<string name="system_informative">Информация о системе</string>
<!--Original value: System Settings-->
<string name="system_settings">Настройки системы</string>
<!--Original value: Time of inactivity in minutes after which the device goes to sleep.-->
<string name="system_sleeptime_edit_summary">Время неактивности в минутах, после которого устройство перейдет в режим сна.</string>
<!--Original value: Sleep Timeout-->
<string name="system_sleeptime_edit_title">Таймаут сна</string>
<!--Original value: ATTENTION: This feature has been removed from AppStarter! Long press home-button to find the option to go to sleep immediately.-->
<string name="gotosleep_summary">ВНИМАНИЕ: Эта функция удалена из AppStarter! Длительное нажатие кнопки Домой для выбора опции немедленного перехода в режим сна.</string>
<!--Original value: Go to sleep-->
<string name="gotosleep_title">Перейти в режим сна</string>
<!--Original value: ATTENTION: If you click here, the device reboots immediately!-->
<string name="system_restart_summary">ВНИМАНИЕ: Если кликнуть здесь, устройство перезагрузится немедленно!</string>
<!--Original value: Reboot-->
<string name="system_restart_title">Перезагрузка</string>
<!--Original value: Please wait, device goes to sleep in a few seconds..-->
<string name="gotosleep_waitforsleep">Подождите пожалуйста, устройство перейдет в режим сна в течение нескольких секунд..</string>
<!--Original value: Going to sleep mode..-->
<string name="gotosleep_waitforsleep_title">Переход в режим сна..</string>
<!--Original value: Only values between %1$d and %2$d minutes are allowed!-->
<string name="sleeptime_limit" formatted="false">Допустимые значения в диапазоне между %1$d и %2$d минут!</string>
<!--Original value: Canceled go to sleep..-->
<string name="gotosleep_cancel">Отмена перехода в режим сна..</string>
<!--Original value: Device Details-->
<string name="devicedetailstitle">Подробнее об устройстве</string>
<!--Original value: App Icon Size-->
<string name="appicon_size_title">Размер иконок приложений</string>
<!--Original value: Size between 0 and 200 (in DPI) of the App-Icons on the main App-Drawer in DPI. Set to 0 for default.-->
<string name="appicon_size_summary">Размер иконок приложений на рабочем столе в диапазоне от 0 до 200 (в DPI). Установите 0 для размера по умолчанию.</string>
<!--Original value: Import / Export-->
<string name="importExport">Импорт / Экспорт</string>
<!--Original value: Export current AppStarter settings to ZIP-File.-->
<string name="importexport_export_summary">Экспорт текущих настроек AppStarter в ZIP файл.</string>
<!--Original value: Export-->
<string name="importexport_export_title">Экспорт</string>
<!--Original value: Import AppStarter Settings from ZIP-File. Be sure to only import trusted ZIP-Files!-->
<string name="importexport_import_summary">Импорт настроек AppStarter из ZIP файла. Импортируйте ZIP файлы только из доверенного источника!</string>
<!--Original value: Import-->
<string name="importexport_import_title">Импорт</string>
<!--Original value: Uptime-->
<string name="deviceuptime">Время с момента включения</string>
<!--Original value: Device is up for %1$s (startup: %2$s)-->
<string name="uptimedesc" formatted="false">Устройство работает %1$s (включено: %2$s)</string>
<!--Original value: If this option is set, all previous instances of the app are cleared and the app is started fresh (nothing from the last activity is restored).-->
<string name="clearpreviousinstance_desc">Если опция установлена, все предыдущие экземпляры приложения будут закрыты и приложение запустится \"с нуля\" (а не восстановит предыдущее состояние).</string>
<!--Original value: Single Click App: Clear previous instances-->
<string name="clearpreviousinstance_singleclick_title">Приложение по одинарному клику: Запускать \"с нуля\"</string>
<!--Original value: Double Click App: Clear previous instances-->
<string name="clearpreviousinstance_doubleclick_title">Приложение по двойному клику: Запускать \"с нуля\"</string>
<!--Original value: Home-Detection via ADB-->
<string name="background_observation_viaadb_title">Отслеживание с помощью ADB</string>
<!--Original value: Use ADB to detect home button clicks. This is more accurate but does only work with ADB running and correctly enabled (disable / enable in settings).-->
<string name="background_observation_viaadb_desc">Использует ADB для обнаружения нажатия кнопки Домой. Более точный метод, но работает только если ADB запущен и правильно активирован (отключить / включить в настройках).</string>
<!--Original value: ATTENTION: This feature has been removed from AppStarter hold "Enter/Select"-Button + "Play"-Button to restart FireTV.-->
<string name="system_restart_summary_removed">ВНИМАНИЕ: Эта функция удалена из AppStarter! Удерживайте кнопки Выбор + Воспроизведение (одновременно) для перезагрузки FireTV.</string>
<!--Original value: Open ADB Settings-->
<string name="open_adb_settings_title">Открыть настройки ADB</string>
<!--Original value: This is a shortcut to open the ADB settings.-->
<string name="open_adb_settings_summary">Ярлык для открытия настроек ADB.</string>
<!--Original value: Observation via ADB-->
<string name="observation_via_adb_title">Отслеживание с помощью ADB</string>
<!--Original value: You have choosen the home button observation via ADB.
For this option it is important, that ADB is enabled. If you are already on FireOS5 (Android v5.1), you have to make sure that no other device is connecting via ADB in parallel. If you want to use tools like adbFire, Amazon FireTV Utility App, Apps2Fire or similar, you should disable the ADB observation of AppStarter and disable/enable ADB before you try to connect.
If you want to use ADB observation of AppStarter again, make sure you disable/enable ADB before using it (Shortcut to ADB settings is below this Setting).-->
<string name="observation_via_adb_summary">Вы выбрали отслеживание нажатия кнопки Домой с помощью ADB.\n\nДля этой опции важно, чтобы ADB был включен. Если у Вас уже FireOS5 (Android v5.1), Вы должны убедиться, что никакое другое устройство не подключено с помощью ADB параллельно. Если Вы хотите использовать такие инструменты, как adbFire, Amazon FireTV Utility App, Apps2Fire или аналоги, необходимо отключить Отслеживание с помощью ADB в AppStarter и отключить / включить ADB прежде чем пытаться подключиться.\n\nЕсли вы снова захотите использовать Отслеживание с помощью ADB в AppStarter, убедитесь, что Вы отключили / включили ADB прежде чем использовать его (Ярлык для открытия настроек ADB находится ниже данного пункта).</string>
<!--Original value: Observation without ADB-->
<string name="observation_without_adb_title">Отслеживание без ADB</string>
<!--Original value: You have choosen the new home button observation without ADB.
This observation of the home-button works only if you are on the original Amazon FireTV Home screen. This means if you are in any other App like Kodi, you have to click the home button once to get to the Amazon FireTV Home screen and then you can single or double click the home-button to perform the action desired.
In practice that means, you can also add one home button click if you are in another app. If you are for example in Kodi, you can do a double-click to the home-button to perform the single click operation and according to this you can do a triple click to perform the double click action.
Sorry for this strange behaviour but due to technical limitations of Android, there is no other possibility without ADB at the moment.-->
<string name="observation_without_adb_summary">Вы выбрали отслеживание нажатия кнопки Домой без ADB (новый метод).\n\nЭтот метод работает только если Вы находитесь на оригинальном домашнем экране Amazon FireTV. Это означает, что если Вы находитесь в любом другом приложении, например Kodi, Вы должны нажать на кнопку Домой один раз, чтобы переключиться на домашний экран Amazon FireTV и затем Вы сможете одинарным или двойным кликом кнопки Домой выполнить необходимое действие.\n\nНа практике это означает, что нужно добавить одно дополнительное нажатие кнопки Домой если находитесь в другом приложении. Например, если Вы находитесь в Kodi, двойной клик Домой запустит действие для одинарного клика, а тройной клик - действие для двойного.\n\nИзвините за это странное поведение, но из-за технических ограничений Android на данный момент нет другой возможности обойтись без ADB.</string>
<!--Original value: Fallback to Non-ADB Observation-->
<string name="fallback_to_nonadb_title">Авто-Переключение на Отслеживание без ADB</string>
<!--Original value: If this option is set and the ADB observation fails for three times, the home button observation is automatically changed to Non-ADB observation.-->
<string name="fallback_to_nonadb_desc">Если опция установлена и Отслеживание с помощью ADB не сработает 3 раза, отслеживание нажатия кнопки Домой автоматически переключится на Отслеживание без ADB.</string>
<!--Original value: Change to non-ADB Observation
The observation with ADB failed more than 3 times. The home-button observation have been automatically changed to non-ADB observation. You can change this behaviour in the AppStarter settings.-->
<string name="adb_fail_auto_observation_change">Переключение на Отслеживание без ADB\n\nОтслеживание с помощью ADB не сработало более 3 раз. Автоматически переключено на Отслеживание без ADB. В настройках AppStarter Вы можете изменить поведение в таких случаях.</string>
<!--Original value: Hide left bar in app drawer-->
<string name="hideleftbarinappoverview_title">Скрыть меню на Рабочем столе</string>
<!--Original value: Left selection bar is hidden when on the main page (App Drawer)-->
<string name="hideleftbarinappoverview_desc">Скрыть левую панель при переходе на главный экран (Рабочий стол)</string>
<!--Original value: Background for App Names (App Drawer)-->
<string name="showbackgroundforappnames_title">Фон для названий приложений (Рабочий стол)</string>
<!--Original value: Shows a background for app names in the app drawer. This helps to read app names, if a wallpaper is used.-->
<string name="showbackgroundforappnames_desc">Показывает фон для названий приложений на Рабочем столе. Помогает читать названия приложений, если установлены обои.</string>
<!--Original value: This feature is only available in FireOS 3 and older..-->
<string name="feature_only_availabe_fireos3_and_older">Эта функция доступна только в FireOS 3 и старше..</string>
<!--Original value: Update Settings-->
<string name="update_settings">Настройки обновления</string>
<!--Original value: Decide which Kodi updates you want to install. If you choose "Nightly", the check for newer version gets useless (install of current version is then always possible).
ATTENTION: To downgrade you always have to uninstall Kodi manually first!-->
<string name="kodi_update_policy_desc">Выберите для какой версии Kodi устанавливать обновления. Если Вы выбрали \"Nightly Builds\", проверка обновлений для другой версии становится бесполезной (будет устанавливаться самая последняя доступная версия).\nВНИМАНИЕ: Для понижения версии Kodi Вы сначала должны удалить Kodi вручную!</string>
<!--Original value: Kodi Update Policy-->
<string name="kodi_update_policy_title">Политика обновления Kodi</string>
<!--Original value: not installed-->
<string name="not_installed">не установлено</string>
</resources>
@@ -0,0 +1,246 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- String resources (non translatable) -->
<!--Original value: AppStarter-->
<string name="AppName">AppStarter</string>
<!-- To be translated -->
<!--Original value: FireTV Home-->
<string name="AmazonHome">FireTV Home</string>
<!--Original value: Now move app and click again to drop
(Press RETURN to CANCEL)-->
<string name="MoveAppAndClickToDrop">Перемістіть програму та клікніть знову на новому місці\n(Натисніть Назад для Відміни)</string>
<!--Original value: Now move app and click to drop
(Press RETURN to CANCEL)-->
<string name="MoveAppAndClickToDropWhenStartedByMenu">Перемістіть програму та клікніть на новому місці\n(Натисніть Назад для Відміни)\n</string>
<!--Original value: loading-->
<string name="loading">завантаження</string>
<!--Original value: Background Observation-->
<string name="background_observation">Фонове відслідковування</string>
<!--Original value: Enable background observation of home-button and startup-event.-->
<string name="enable_background_observation_desc">Відслідковувати в фоновому режимі натискання кнопки Додому та старт Fire TV.</string>
<!--Original value: Enable background observation.-->
<string name="enable_background_observation_title">Ввімкнути фонове відслідковування.</string>
<!--Original value: IP Address-->
<string name="iptitle">IP адреса</string>
<!--Original value: Hostname-->
<string name="hostnametitle">Ім\'я хоста</string>
<!--Original value: not found..-->
<string name="notfound">не знайдено...</string>
<!--Original value: AppStarter Version-->
<string name="appstarterversiontitle">Версія AppStarter</string>
<!--Original value: App that is started on FireTV startup-->
<string name="startup_app_desc">Програма, яка запуститься при старті Fire TV</string>
<!--Original value: Startup Application-->
<string name="startup_app_title">Стартова програма</string>
<!--Original value: App that is started on home button single click.-->
<string name="singleclick_app_desc">Програма, яка запуститься одинарним кліком кнопки Додому.</string>
<!--Original value: Home Button Single Click Application-->
<string name="singleclick_app_title">Кнопка Додому - програма по одинарному кліку</string>
<!--Original value: App that is started on home button double click.-->
<string name="doubleclick_app_desc">Програма, яка запуститься подвійним кліком кнопки Додому.</string>
<!--Original value: Home Button Double Click Application-->
<string name="doubleclick_app_title">Кнопка Додому - програма по подвійному кліку</string>
<!--Original value: Show also system apps in app list.-->
<string name="showsysapps_desc">Показувати також системні програми в меню Програми.</string>
<!--Original value: Show system apps-->
<string name="showsysapps_title">Показувати системні програми</string>
<!--Original value: Apps that shall not be shown in apps list.-->
<string name="hiddenapps_desc">Програми, які не будуть показані в меню Програми.</string>
<!--Original value: Hidden Apps-->
<string name="hiddenapps_title">Приховані Програми</string>
<!--Original value: App Listing Settings-->
<string name="applist_settings">Налаштування переліку програм / меню Програми</string>
<!--Original value: Observer Timings-->
<string name="settings_timings">Часові затримки</string>
<!--Original value: Define the time in milliseconds (between 100 - 1000) to wait for the second click-->
<string name="doubleclick_interval_desc">Вкажіть час в мілісекундах (в межах 100 - 1000) для очікування другого кліка</string>
<!--Original value: Double click interval-->
<string name="doubleclick_interval_title">Інтервал подвійного кліка</string>
<!--Original value: is invalid for this setting!-->
<string name="is_invalid_number">некоректно для данного налаштування!</string>
<!--Original value: Current AppStarter Version-->
<string name="update_currentversion">Поточна версія AppStarter</string>
<!--Original value: Current Kodi Version-->
<string name="update_currentversion_kodi">Поточна версія Kodi</string>
<!--Original value: Install-->
<string name="install">Встановлення</string>
<!--Original value: Latest AppStarter Version-->
<string name="serverVersion">Остання версія AppStarter</string>
<!--Original value: Latest Kodi Version-->
<string name="serverVersion_kodi">Остання версія Kodi</string>
<!--Original value: Check for Update-->
<string name="update_checkfor">Перевірити оновлення</string>
<!--Original value: Update to latest Version-->
<string name="update">Оновити до останньої версії</string>
<!--Original value: Hit check for update to check for latest version.-->
<string name="update_hitcheckfor">Натисніть Перевірити оновлення для перевірки наявності оновлення.</string>
<!--Original value: Auto select the first icon when switching to the app drawer (All Apps).-->
<string name="autoselectfirsticon_desc">Авто вибір першої іконки при переході на Робочий стіл (Всі Програми).</string>
<!--Original value: Auto select first icon (App Drawer)-->
<string name="autoselectfirsricon_title">Авто вибір першої іконки (Робочий стіл)</string>
<!--Original value: AppStarter is a Non-Root Launcher Replacement / App-Drawer for Amazon FireTV:
Visit discussion on XDA-Developers:
http://forum.xda-developers.com/fire-tv/themes-apps/app-root-home-launcher-replacement-app-t3118135
AppStarter is Open-Source, visit project on GitHub:
https://github.com/sphinx02/AppStarter-->
<string name="about_appstarter">AppStarter - заміна лаунчера / робочий стіл для Amazon Fire TV (не потребує root):\n\nВідвідайте тему на XDA-Developers:\nhttp://forum.xda-developers.com/fire-tv/themes-apps/app-root-home-launcher-replacement-app-t3118135\n\nAppStarter являється Open-Source, відвідайте проект на GitHub:\nhttps://github.com/sphinx02/AppStarter</string>
<!--Original value: The time window in milliseconds (between 0 - 10000) in which AppStarter prevents the amazon home launcher from coming to foreground when click-actions have been performed. Set to 0 to disable.-->
<string name="jumpbackwatchdogtime_desc">Час в мілісекундах (в межах 0 - 10000), на протязі якого AppStarter запобігає показу стартового екрану Amazon при виконанні клік-дій. Встановіть 0 для відключення.</string>
<!--Original value: Jump Back Watchdog Time-->
<string name="jumpbackwatchdogtime_title">Час запобігання показу стартового екрана Amazon</string>
<!--Original value: FireTV Settings-->
<string name="AmazonSettings">Налаштування Fire TV</string>
<!--Original value: Apps-->
<string name="leftbar_allapps">Програми</string>
<!--Original value: System-->
<string name="leftbar_infos">Система</string>
<!--Original value: Updates-->
<string name="leftbar_updates">Оновлення</string>
<!--Original value: Install-->
<string name="leftbar_install">Встановлення</string>
<!--Original value: Settings-->
<string name="leftbar_settings">Налаштування</string>
<!--Original value: Move-->
<string name="appsettingssort">Переміщення</string>
<!--Original value: App Settings-->
<string name="appsettings_settings">Налаштування</string>
<!--Original value: Language Settings-->
<string name="language_settings">Мовні налаштування</string>
<!--Original value: Set language manually.-->
<string name="language_summary">Вказати мову вручну.</string>
<!--Original value: Language-->
<string name="language_title">Мова</string>
<!--Original value: Checking for updates-->
<string name="update_checkfortitle">Перевірка оновлення</string>
<!--Original value: Check for latest release version.-->
<string name="update_checkfordesc">Пошук останньої версії.</string>
<!--Original value: Check for update.-->
<string name="update_checkformessage">Перевіряємо наявність оновлення.</string>
<!--Original value: Found newer Version - Update Now!-->
<string name="update_foundnew">Знайдено нову версію - Оновіть зараз!</string>
<!--Original value: You have already the newest version!-->
<string name="update_foundnotnew">Ви вже використовуєте останню версію!</string>
<!--Original value: Reboot-->
<string name="power_reboot">Перезавантаження</string>
<!--Original value: WiFi / WLAN Name (SSID)-->
<string name="wifissidtitle">Ім\'я WiFi / WLAN (SSID)</string>
<!--Original value: Layout Settings-->
<string name="layout_settings">Налаштування відображення</string>
<!--Original value: Set a custom background image / wallpaper for AppStarter-->
<string name="wallpaper_summary">Встановіть власне фонове зображення / шпалери для AppStarter</string>
<!--Original value: Wallpaper / Background Image-->
<string name="wallpaper_title">Шпалери / Фонове зображення</string>
<!--Original value: Remove Wallpaper-->
<string name="remove_wallpaper">Видалити шпалери</string>
<!--Original value: Select Wallpaper-->
<string name="select_wallpaper">Вибрати шпалери</string>
<!--Original value: Sleep-->
<string name="power_sleep">Сон</string>
<!--Original value: System Information-->
<string name="system_informative">Інформація про систему</string>
<!--Original value: System Settings-->
<string name="system_settings">Налаштування системи</string>
<!--Original value: Time of inactivity in minutes after which the device goes to sleep.-->
<string name="system_sleeptime_edit_summary">Час неактивності в хвилинах, після якого пристрій перейде в режим сна.</string>
<!--Original value: Sleep Timeout-->
<string name="system_sleeptime_edit_title">Таймаут сна</string>
<!--Original value: ATTENTION: This feature has been removed from AppStarter! Long press home-button to find the option to go to sleep immediately.-->
<string name="gotosleep_summary">УВАГА: Ця функція видалена з AppStarter! Тривале натискання кнопки Додому для вибору опції негайного переходу в режим сна.</string>
<!--Original value: Go to sleep-->
<string name="gotosleep_title">Перейти в режим сна</string>
<!--Original value: ATTENTION: If you click here, the device reboots immediately!-->
<string name="system_restart_summary">УВАГА: Якщо клікнути тут, пристрій перезавантажиться негайно!</string>
<!--Original value: Reboot-->
<string name="system_restart_title">Перезавантаження</string>
<!--Original value: Please wait, device goes to sleep in a few seconds..-->
<string name="gotosleep_waitforsleep">Зачекайте, будь ласка, пристрій перейде в режим сна на протязі декількох секунд..</string>
<!--Original value: Going to sleep mode..-->
<string name="gotosleep_waitforsleep_title">Перехід в режим сна..</string>
<!--Original value: Only values between %1$d and %2$d minutes are allowed!-->
<string name="sleeptime_limit" formatted="false">Допустимі значення в діапазоні між %1$d та %2$d хвилин!</string>
<!--Original value: Canceled go to sleep..-->
<string name="gotosleep_cancel">Відміна переходу в режим сна..</string>
<!--Original value: Device Details-->
<string name="devicedetailstitle">Детальніше про пристрій</string>
<!--Original value: App Icon Size-->
<string name="appicon_size_title">Розмір іконок програм</string>
<!--Original value: Size between 0 and 200 (in DPI) of the App-Icons on the main App-Drawer in DPI. Set to 0 for default.-->
<string name="appicon_size_summary">Розмір іконок програм на робочому столі в діапазоні від 0 до 200 (в DPI). Встановіть 0 для розміру за замовчуванням.</string>
<!--Original value: Import / Export-->
<string name="importExport">Імпорт / Експорт</string>
<!--Original value: Export current AppStarter settings to ZIP-File.-->
<string name="importexport_export_summary">Експорт поточних налаштувань AppStarter в ZIP файл.</string>
<!--Original value: Export-->
<string name="importexport_export_title">Експорт</string>
<!--Original value: Import AppStarter Settings from ZIP-File. Be sure to only import trusted ZIP-Files!-->
<string name="importexport_import_summary">Імпорт налаштувань AppStarter з ZIP файла. Імпортуйте ZIP файли тільки з довіреного джерела!</string>
<!--Original value: Import-->
<string name="importexport_import_title">Імпорт</string>
<!--Original value: Uptime-->
<string name="deviceuptime">Час з моменту ввімкнення</string>
<!--Original value: Device is up for %1$s (startup: %2$s)-->
<string name="uptimedesc" formatted="false">Пристрій працює %1$s (ввімкнено: %2$s)</string>
<!--Original value: If this option is set, all previous instances of the app are cleared and the app is started fresh (nothing from the last activity is restored).-->
<string name="clearpreviousinstance_desc">Якщо опція активна, всі попередні екземпляри програми будуть закриті та програма запуститься \"з нуля\" (а не відновить попередній стан).</string>
<!--Original value: Single Click App: Clear previous instances-->
<string name="clearpreviousinstance_singleclick_title">Програма по одинарному кліку: Запускати \"з нуля\"</string>
<!--Original value: Double Click App: Clear previous instances-->
<string name="clearpreviousinstance_doubleclick_title">Програма по подвійному кліку: Запускати \"з нуля\"</string>
<!--Original value: Home-Detection via ADB-->
<string name="background_observation_viaadb_title">Відслідковування за допомогою ADB</string>
<!--Original value: Use ADB to detect home button clicks. This is more accurate but does only work with ADB running and correctly enabled (disable / enable in settings).-->
<string name="background_observation_viaadb_desc">Використовує ADB для виявлення натискання кнопки Додому. Більш точний метод, але працює тільки якщо ADB запущений та правильно активований (відключити / включити в налаштуваннях).</string>
<!--Original value: ATTENTION: This feature has been removed from AppStarter hold "Enter/Select"-Button + "Play"-Button to restart FireTV.-->
<string name="system_restart_summary_removed">УВАГА: Ця функція видалена з AppStarter! Утримуйте кнопки Вибір + Програвання (одночасно) для перезавантаження Fire TV.</string>
<!--Original value: Open ADB Settings-->
<string name="open_adb_settings_title">Відкрити налаштування ADB</string>
<!--Original value: This is a shortcut to open the ADB settings.-->
<string name="open_adb_settings_summary">Ярлик для відкриття налаштувань ADB.</string>
<!--Original value: Observation via ADB-->
<string name="observation_via_adb_title">Відслідковування за допомогою ADB</string>
<!--Original value: You have choosen the home button observation via ADB.
For this option it is important, that ADB is enabled. If you are already on FireOS5 (Android v5.1), you have to make sure that no other device is connecting via ADB in parallel. If you want to use tools like adbFire, Amazon FireTV Utility App, Apps2Fire or similar, you should disable the ADB observation of AppStarter and disable/enable ADB before you try to connect.
If you want to use ADB observation of AppStarter again, make sure you disable/enable ADB before using it (Shortcut to ADB settings is below this Setting).-->
<string name="observation_via_adb_summary">Ви обрали відстеження натискання кнопки Додому за допомогою ADB.\n\nДля цієї опції важливо, щоб ADB був включений. Якщо у Вас вже FireOS5 (Android v5.1), Ви повинні переконатися, що ніякий інший пристрій не підключений за допомогою ADB паралельно. Якщо Ви бажаєте використовувати такі інструменти, як adbFire, Amazon FireTV Utility App, Apps2Fire або аналоги, необхідно відключити Відстеження за допомогою ADB в AppStarter та відключити / включити ADB перш ніж намагатися підключитися.\n\nЯкщо ви знову захочете використовувати Відстеження за допомогою ADB в AppStarter, переконайтеся, що Ви відключили / включили ADB перш ніж використовувати його (Ярлик для відкриття налаштувань ADB знаходиться нижче даного пункту).</string>
<!--Original value: Observation without ADB-->
<string name="observation_without_adb_title">Відслідковування без ADB</string>
<!--Original value: You have choosen the new home button observation without ADB.
This observation of the home-button works only if you are on the original Amazon FireTV Home screen. This means if you are in any other App like Kodi, you have to click the home button once to get to the Amazon FireTV Home screen and then you can single or double click the home-button to perform the action desired.
In practice that means, you can also add one home button click if you are in another app. If you are for example in Kodi, you can do a double-click to the home-button to perform the single click operation and according to this you can do a triple click to perform the double click action.
Sorry for this strange behaviour but due to technical limitations of Android, there is no other possibility without ADB at the moment.-->
<string name="observation_without_adb_summary">Ви обрали відстеження натискання кнопки Додому без ADB (новий метод).\n\nЦей метод працює тільки якщо Ви знаходитесь на оригінальному домашньому екрані Amazon FireTV. Це означає, що якщо Ви перебуваєте в будь-якій іншій програмі, наприклад Kodi, Ви повинні натиснути на кнопку Додому один раз, щоб переключитися на домашній екран Amazon FireTV і потім Ви зможете одинарним або подвійним кліком кнопки Додому виконати необхідну дію.\n\nНа практиці це означає, що потрібно додати одне додаткове натискання кнопки Додому якщо перебуваєте в іншій програмі. Наприклад, якщо Ви перебуваєте в Kodi, подвійний клік Додому запустить дію для одинарного кліка, а потрійний клік - дію для подвійного.\n\nВибачте за таку дивну поведінку, але через технічні обмеження Android на даний момент немає іншої можливості обійтися без ADB.</string>
<!--Original value: Fallback to Non-ADB Observation-->
<string name="fallback_to_nonadb_title">Авто-Перемикання на Відслідковування без ADB</string>
<!--Original value: If this option is set and the ADB observation fails for three times, the home button observation is automatically changed to Non-ADB observation.-->
<string name="fallback_to_nonadb_desc">Якщо опція активна та Відслідковування за допомогою ADB не спрацює 3 рази, відстеження натискання кнопки Додому автоматично переключиться на Відслідковування без ADB.</string>
<!--Original value: Change to non-ADB Observation
The observation with ADB failed more than 3 times. The home-button observation have been automatically changed to non-ADB observation. You can change this behaviour in the AppStarter settings.-->
<string name="adb_fail_auto_observation_change">Перемикання на Відслідковування без ADB\n\nВідслідковування за допомогою ADB не спрацювало більше 3 раз. Автоматично переключено на Відслідковування без ADB. У налаштуваннях AppStarter Ви можете змінити поведінку в таких випадках.</string>
<!--Original value: Hide left bar in app drawer-->
<string name="hideleftbarinappoverview_title">Приховати меню на Робочому столі</string>
<!--Original value: Left selection bar is hidden when on the main page (App Drawer)-->
<string name="hideleftbarinappoverview_desc">Приховати ліву панель при переході на головний екран (Робочий стіл)</string>
<!--Original value: Background for App Names (App Drawer)-->
<string name="showbackgroundforappnames_title">Фон для назв програм (Робочий стіл)</string>
<!--Original value: Shows a background for app names in the app drawer. This helps to read app names, if a wallpaper is used.-->
<string name="showbackgroundforappnames_desc">Показує фон для назв програм на Робочому столі. Допомагає читати назви програм, якщо встановлені шпалери.</string>
<!--Original value: This feature is only available in FireOS 3 and older..-->
<string name="feature_only_availabe_fireos3_and_older">Ця функція доступна тільки в FireOS 3 та вище..</string>
<!--Original value: Update Settings-->
<string name="update_settings">Налаштування оновлення</string>
<!--Original value: Decide which Kodi updates you want to install. If you choose "Nightly", the check for newer version gets useless (install of current version is then always possible).
ATTENTION: To downgrade you always have to uninstall Kodi manually first!-->
<string name="kodi_update_policy_desc">Виберіть для якої версії Kodi встановлювати оновлення. Якщо Ви вибрали \"Nightly Builds\", перевірка оновлень для іншої версії стає марною (буде встановлюватися найостанніша доступна версія).\nУВАГА: Для пониження версії Kodi Ви спочатку повинні видалити Kodi вручну!</string>
<!--Original value: Kodi Update Policy-->
<string name="kodi_update_policy_title">Політика оновлення Kodi</string>
<!--Original value: not installed-->
<string name="not_installed">не встановлено</string>
</resources>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="divider">#ffffce55</color>
<color name="appselectorhighlight">#ffffce55</color>
<color name="prefdivider">#FFFFFF</color>
<color name="whitedivider">#FFFFFF</color>
<color name="semitransparentbackground_dark">#99000000</color>
<color name="semitransparentbackground_medium">#80000000</color>
<color name="semitransparentbackground_light">#66000000</color>
</resources>
@@ -0,0 +1,26 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="prefdividermarginbottom">5dp</dimen>
<dimen name="prefheadermarginbottom">10dp</dimen>
<dimen name="prefheadermargintop">15dp</dimen>
<dimen name="prefdividerbigheight">2dp</dimen>
<dimen name="prefdividersmallheight">1dp</dimen>
<dimen name="prefdividermargintop">5dp</dimen>
<dimen name="textsizeinfotitle">20dp</dimen>
<dimen name="textsizeinfo">16dp</dimen>
<dimen name="infodividerheight">1dp</dimen>
<dimen name="infodivicermargintopbottom">10dp</dimen>
<dimen name="settingspadding">25dp</dimen>
<dimen name="settingspadding_bottom">0dp</dimen>
<dimen name="appsettingsoptionpadding">20dp</dimen>
<dimen name="appsettingboxsize">150dp</dimen>
<dimen name="appsettingboxsize_small">120dp</dimen>
<dimen name="settingsiconsize">80dp</dimen>
<dimen name="applisting_itemsize">125dp</dimen>
<dimen name="leftbarwidth">170dp</dimen>
<item type="dimen" name="bg_grad_center_x">0.1</item>
<item type="dimen" name="bg_grad_center_y">0.1</item>
<item type="dimen" name="bg_grad_size">1900.0</item>
</resources>
@@ -0,0 +1,115 @@
<resources>
<!-- String resources (non translatable) -->
<string name="AppName">SideQuest</string>
<!-- To be translated -->
<string name="AmazonHome">FireTV Home</string>
<string name="MoveAppAndClickToDrop">Now move app and click again to drop \n(Press RETURN to CANCEL)</string>
<string name="MoveAppAndClickToDropWhenStartedByMenu">Now move app and click to drop \n(Press RETURN to CANCEL)</string>
<string name="loading">loading</string>
<string name="background_observation">Background Observation</string>
<string name="enable_background_observation_desc">Enable background observation of home-button and startup-event.</string>
<string name="enable_background_observation_title">Enable background observation.</string>
<string name="iptitle">IP Address</string>
<string name="hostnametitle">Hostname</string>
<string name="notfound">not found..</string>
<string name="appstarterversiontitle">AppStarter Version</string>
<string name="startup_app_desc">App that is started on FireTV startup</string>
<string name="startup_app_title">Startup Application</string>
<string name="singleclick_app_desc">App that is started on home button single click.</string>
<string name="singleclick_app_title">Home Button Single Click Application</string>
<string name="doubleclick_app_desc">App that is started on home button double click.</string>
<string name="doubleclick_app_title">Home Button Double Click Application</string>
<string name="showsysapps_desc">Show also system apps in app list.</string>
<string name="showsysapps_title">Show system apps</string>
<string name="hiddenapps_desc">Apps that shall not be shown in apps list.</string>
<string name="hiddenapps_title">Hidden Apps</string>
<string name="applist_settings">App Listing Settings</string>
<string name="settings_timings">Observer Timings</string>
<string name="doubleclick_interval_desc">Define the time in milliseconds (between 100 - 1000) to wait for the second click</string>
<string name="doubleclick_interval_title">Double click interval</string>
<string name="is_invalid_number">is invalid for this setting!</string>
<string name="update_currentversion">Current AppStarter Version</string>
<string name="update_currentversion_kodi">Current Kodi Version</string>
<string name="install">Install</string>
<string name="serverVersion">Latest AppStarter Version</string>
<string name="serverVersion_kodi">Latest Kodi Version</string>
<string name="update_checkfor">Check for Update</string>
<string name="update">Update to latest Version</string>
<string name="update_hitcheckfor">Hit check for update to check for latest version.</string>
<string name="autoselectfirsticon_desc">Auto select the first icon when switching to the app drawer (All Apps).</string>
<string name="autoselectfirsricon_title">Auto select first icon (App Drawer)</string>
<string name="about_appstarter">AppStarter is a Non-Root Launcher Replacement / App-Drawer for Amazon FireTV:\n\nVisit discussion on XDA-Developers:\nhttp://forum.xda-developers.com/fire-tv/themes-apps/app-root-home-launcher-replacement-app-t3118135\n\nAppStarter is Open-Source, visit project on GitHub:\nhttps://github.com/sphinx02/AppStarter</string>
<string name="jumpbackwatchdogtime_desc">The time window in milliseconds (between 0 - 10000) in which AppStarter prevents the amazon home launcher from coming to foreground when click-actions have been performed. Set to 0 to disable.</string>
<string name="jumpbackwatchdogtime_title">Jump Back Watchdog Time</string>
<string name="AmazonSettings">FireTV Settings</string>
<string name="leftbar_allapps">Apps</string>
<string name="leftbar_infos">System</string>
<string name="leftbar_updates">Updates</string>
<string name="leftbar_install">Install</string>
<string name="leftbar_settings">Settings</string>
<string name="appsettingssort">Move</string>
<string name="appsettings_settings">App Settings</string>
<string name="language_settings">Language Settings</string>
<string name="language_summary">Set language manually.</string>
<string name="language_title">Language</string>
<string name="update_checkfortitle">Checking for updates</string>
<string name="update_checkfordesc">Check for latest release version.</string>
<string name="update_checkformessage">Check for update.</string>
<string name="update_foundnew">Found newer Version - Update Now!</string>
<string name="update_foundnotnew">You have already the newest version!</string>
<string name="power_reboot">Reboot</string>
<string name="wifissidtitle">WiFi / WLAN Name (SSID)</string>
<string name="layout_settings">Layout Settings</string>
<string name="wallpaper_summary">Set a custom background image / wallpaper for AppStarter</string>
<string name="wallpaper_title">Wallpaper / Background Image</string>
<string name="remove_wallpaper">Remove Wallpaper</string>
<string name="select_wallpaper">Select Wallpaper</string>
<string name="power_sleep">Sleep</string>
<string name="system_informative">System Information</string>
<string name="system_settings">System Settings</string>
<string name="system_sleeptime_edit_summary">Time of inactivity in minutes after which the device goes to sleep.</string>
<string name="system_sleeptime_edit_title">Sleep Timeout</string>
<string name="gotosleep_summary">ATTENTION: This feature has been removed from AppStarter! Long press home-button to find the option to go to sleep immediately.</string>
<string name="gotosleep_title">Go to sleep</string>
<string name="system_restart_summary">ATTENTION: If you click here, the device reboots immediately!</string>
<string name="system_restart_title">Reboot</string>
<string name="gotosleep_waitforsleep">Please wait, device goes to sleep in a few seconds..</string>
<string name="gotosleep_waitforsleep_title">Going to sleep mode..</string>
<string name="sleeptime_limit">Only values between %1$d and %2$d minutes are allowed!</string>
<string name="gotosleep_cancel">Canceled go to sleep..</string>
<string name="devicedetailstitle">Device Details</string>
<string name="appicon_size_title">App Icon Size</string>
<string name="appicon_size_summary">Size between 0 and 200 (in DPI) of the App-Icons on the main App-Drawer in DPI. Set to 0 for default.</string>
<string name="importExport">Import / Export</string>
<string name="importexport_export_summary">Export current AppStarter settings to ZIP-File.</string>
<string name="importexport_export_title">Export</string>
<string name="importexport_import_summary">Import AppStarter Settings from ZIP-File. Be sure to only import trusted ZIP-Files!</string>
<string name="importexport_import_title">Import</string>
<string name="deviceuptime">Uptime</string>
<string name="uptimedesc">Device is up for %1$s (startup: %2$s)</string>
<string name="clearpreviousinstance_desc">If this option is set, all previous instances of the app are cleared and the app is started fresh (nothing from the last activity is restored).</string>
<string name="clearpreviousinstance_singleclick_title">Single Click App: Clear previous instances</string>
<string name="clearpreviousinstance_doubleclick_title">Double Click App: Clear previous instances</string>
<string name="background_observation_viaadb_title">Home-Detection via ADB</string>
<string name="background_observation_viaadb_desc">Use ADB to detect home button clicks. This is more accurate but does only work with ADB running and correctly enabled (disable / enable in settings).</string>
<string name="system_restart_summary_removed">ATTENTION: This feature has been removed from AppStarter hold \"Enter/Select\"-Button + \"Play\"-Button to restart FireTV.</string>
<string name="open_adb_settings_title">Open ADB Settings</string>
<string name="open_adb_settings_summary">This is a shortcut to open the ADB settings.</string>
<string name="observation_via_adb_title">Observation via ADB</string>
<string name="observation_via_adb_summary">You have choosen the home button observation via ADB.\n\nFor this option it is important, that ADB is enabled. If you are already on FireOS5 (Android v5.1), you have to make sure that no other device is connecting via ADB in parallel. If you want to use tools like adbFire, Amazon FireTV Utility App, Apps2Fire or similar, you should disable the ADB observation of AppStarter and disable/enable ADB before you try to connect.\n\nIf you want to use ADB observation of AppStarter again, make sure you disable/enable ADB before using it (Shortcut to ADB settings is below this Setting).</string>
<string name="observation_without_adb_title">Observation without ADB</string>
<string name="observation_without_adb_summary">You have choosen the new home button observation without ADB.\n\nThis observation of the home-button works only if you are on the original Amazon FireTV Home screen. This means if you are in any other App like Kodi, you have to click the home button once to get to the Amazon FireTV Home screen and then you can single or double click the home-button to perform the action desired.\n\nIn practice that means, you can also add one home button click if you are in another app. If you are for example in Kodi, you can do a double-click to the home-button to perform the single click operation and according to this you can do a triple click to perform the double click action.\n\nSorry for this strange behaviour but due to technical limitations of Android, there is no other possibility without ADB at the moment.</string>
<string name="fallback_to_nonadb_title">Fallback to Non-ADB Observation</string>
<string name="fallback_to_nonadb_desc">If this option is set and the ADB observation fails for three times, the home button observation is automatically changed to Non-ADB observation.</string>
<string name="adb_fail_auto_observation_change">Change to non-ADB Observation\n\nThe observation with ADB failed more than 3 times. The home-button observation have been automatically changed to non-ADB observation. You can change this behaviour in the AppStarter settings.</string>
<string name="hideleftbarinappoverview_title">Hide left bar in app drawer</string>
<string name="hideleftbarinappoverview_desc">Left selection bar is hidden when on the main page (App Drawer)</string>
<string name="showbackgroundforappnames_title">Background for App Names (App Drawer)</string>
<string name="showbackgroundforappnames_desc">Shows a background for app names in the app drawer. This helps to read app names, if a wallpaper is used.</string>
<string name="feature_only_availabe_fireos3_and_older">This feature is only available in FireOS 3 and older..</string>
<string name="update_settings">Update Settings</string>
<string name="kodi_update_policy_desc">Decide which Kodi updates you want to install. If you choose \"Nightly\", the check for newer version gets useless (install of current version is then always possible).\nATTENTION: To downgrade you always have to uninstall Kodi manually first!</string>
<string name="kodi_update_policy_title">Kodi Update Policy</string>
<string name="not_installed">not installed</string>
</resources>
@@ -0,0 +1,37 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Black.NoTitleBar">
<!-- Customize your theme here. -->
<item name="android:listSeparatorTextViewStyle">@style/PreferenceListHeader</item>
</style>
<style name="Widget.TextView.ListSeparator" parent="@android:style/Widget.TextView">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">14sp</item>
<item name="android:gravity">center_vertical</item>
</style>
<style name="PreferenceListHeader" parent="Widget.TextView.ListSeparator">
<item name="android:textColor">#000000</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">18sp</item>
<item name="android:background">#64cccccc</item>
<item name="android:paddingTop">6dp</item>
<item name="android:paddingBottom">6dp</item>
<item name="android:paddingLeft">12dp</item>
</style>
<style name="TransparentDialog" parent="@android:style/Theme">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:background">@android:color/transparent</item>
</style>
<style name="DialogAnimation">
<item name="android:windowEnterAnimation">@anim/appsettings_overlay_in</item>
<item name="android:windowExitAnimation">@anim/appsettings_overlay_out</item>
</style>
</resources>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<PreferenceCategory android:title="@string/system_informative">
<Preference
android:key="prefVirtualDeviceDetails"
android:summary="@string/notfound"
android:title="@string/devicedetailstitle" />
<Preference
android:key="prefVirtualHostname"
android:summary="@string/notfound"
android:title="@string/hostnametitle" />
<Preference
android:key="prefVirtualWifiName"
android:summary="@string/notfound"
android:title="@string/wifissidtitle" />
<Preference
android:key="prefVirtualIpAddress"
android:summary="@string/notfound"
android:title="@string/iptitle" />
<Preference
android:key="prefVirtualDeviceUpTime"
android:summary="@string/notfound"
android:title="@string/deviceuptime" />
</PreferenceCategory>
</PreferenceScreen>
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<PreferenceCategory android:title="@string/layout_settings">
<ListPreference
android:key="prefLanguage"
android:summary="@string/language_summary"
android:title="@string/language_title" />
<EditTextPreference
android:inputType="number"
android:numeric="integer"
android:digits="0123456789"
android:key="prefAppIconSize"
android:summary="@string/appicon_size_summary"
android:title="@string/appicon_size_title" />
<Preference
android:key="prefWallpaper"
android:summary="@string/wallpaper_summary"
android:title="@string/wallpaper_title" />
<CheckBoxPreference
android:defaultValue="false"
android:key="prefShowBackgroundForAppNames"
android:summary="@string/showbackgroundforappnames_desc"
android:title="@string/showbackgroundforappnames_title" />
<CheckBoxPreference
android:defaultValue="false"
android:key="prefHideLeftBarInAppOverview"
android:summary="@string/hideleftbarinappoverview_desc"
android:title="@string/hideleftbarinappoverview_title" />
<CheckBoxPreference
android:defaultValue="true"
android:key="prefAutoSelectFirstIcon"
android:summary="@string/autoselectfirsticon_desc"
android:title="@string/autoselectfirsricon_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/applist_settings">
<CheckBoxPreference
android:defaultValue="false"
android:key="prefShowSysApps"
android:summary="@string/showsysapps_desc"
android:title="@string/showsysapps_title" />
<MultiSelectListPreference
android:dialogTitle="@string/hiddenapps_title"
android:key="prefHiddenApps"
android:summary="@string/hiddenapps_desc"
android:title="@string/hiddenapps_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/importExport">
<Preference
android:key="prefExportCurrentSettings"
android:summary="@string/importexport_export_summary"
android:title="@string/importexport_export_title" />
<Preference
android:key="prefImportCurrentSettings"
android:summary="@string/importexport_import_summary"
android:title="@string/importexport_import_title" />
</PreferenceCategory>
</PreferenceScreen>