mirror of
https://gitlab.com/neothefox/LayTray
synced 2026-03-23 21:54:54 +03:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6714018074 | |||
|
|
8167c776d7 | ||
| d137306d09 | |||
| 9c62b6a457 | |||
| bdd885de67 | |||
| 1358857959 | |||
| 630d19514d | |||
|
|
8b11d25111 | ||
| e245cd7a62 | |||
| 644c11097b | |||
| c8d71ad7a9 | |||
| 0cd75e6760 | |||
| 4498c4716f | |||
| bdaa3e84d5 | |||
| 9f6332f9b4 | |||
| 7de80ab3ec | |||
| 2af2de6572 | |||
| 6599166077 | |||
| a2779d2585 | |||
| 85ee301a16 | |||
| bccc0bca6c | |||
| 20331b629b | |||
| 4c92f97ab3 | |||
| cf94f7c9bb | |||
| 1a01c6430e | |||
|
|
86e1efe3a9 | ||
|
|
654884c2bd | ||
| cb77503a63 | |||
| f312ffb047 | |||
| 3545b82c31 | |||
| 6b850077b7 | |||
| 3e2d80eae1 | |||
| ab6068975d | |||
| a16083b21d |
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.gradle
|
||||||
|
.idea
|
||||||
|
build
|
||||||
|
LayTray.iml
|
||||||
|
local.properties
|
||||||
|
|
||||||
|
app/app.iml
|
||||||
|
app/release
|
||||||
|
app/build
|
||||||
12
README.md
Normal file
12
README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# LayTray
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
This app keeps a small text icon in the notification area to let you know what Layout you are using. Developed for Blackberry KeyOne and possibly other QWERTY phones. This is based on the Toast notification that keyboard produces upon switching layouts.
|
||||||
|
|
||||||
|
An icon can help users with short-term memory problems or vision problems interact with their device.
|
||||||
|
|
||||||
|
## Get it
|
||||||
|
[Play Store](https://play.google.com/store/apps/details?id=space.neothefox.laytray)
|
||||||
|
[F-Droid](https://f-droid.org/en/packages/space.neothefox.laytray/)
|
||||||
|
|
||||||
@ -1,13 +1,13 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 26
|
compileSdkVersion 27
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "space.neothefox.laytray"
|
applicationId "space.neothefox.laytray"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 26
|
targetSdkVersion 27
|
||||||
versionCode 6
|
versionCode 11
|
||||||
versionName "1.5"
|
versionName "1.10"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@ -21,12 +21,10 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation 'com.android.support:appcompat-v7:26.1.0'
|
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||||
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
||||||
implementation 'com.android.support:support-v4:26.1.0'
|
implementation 'com.android.support:support-v4:27.1.1'
|
||||||
testImplementation 'junit:junit:4.12'
|
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||||
implementation 'com.android.support:design:26.1.0'
|
implementation 'com.android.support:design:27.1.1'
|
||||||
implementation 'com.github.javadev:underscore:1.34'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,9 @@
|
|||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" >
|
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" >
|
||||||
|
<meta-data
|
||||||
|
android:name="android.accessibilityservice"
|
||||||
|
android:resource="@xml/accessibility_service_config" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.accessibilityservice.AccessibilityService" />
|
<action android:name="android.accessibilityservice.AccessibilityService" />
|
||||||
|
|||||||
@ -3,10 +3,12 @@ package space.neothefox.laytray;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
public class AboutActivity extends Activity {
|
public class AboutActivity extends Activity
|
||||||
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_about);
|
setContentView(R.layout.activity_about);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,19 +16,22 @@ import android.view.ViewGroup;
|
|||||||
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
|
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
|
||||||
* to be used with AppCompat.
|
* to be used with AppCompat.
|
||||||
*/
|
*/
|
||||||
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
|
public abstract class AppCompatPreferenceActivity extends PreferenceActivity
|
||||||
|
{
|
||||||
|
|
||||||
private AppCompatDelegate mDelegate;
|
private AppCompatDelegate mDelegate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
getDelegate().installViewFactory();
|
getDelegate().installViewFactory();
|
||||||
getDelegate().onCreate(savedInstanceState);
|
getDelegate().onCreate(savedInstanceState);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
protected void onPostCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
super.onPostCreate(savedInstanceState);
|
super.onPostCreate(savedInstanceState);
|
||||||
getDelegate().onPostCreate(savedInstanceState);
|
getDelegate().onPostCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
@ -37,17 +40,20 @@ public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
|
|||||||
return getDelegate().getSupportActionBar();
|
return getDelegate().getSupportActionBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSupportActionBar(@Nullable Toolbar toolbar) {
|
public void setSupportActionBar(@Nullable Toolbar toolbar)
|
||||||
|
{
|
||||||
getDelegate().setSupportActionBar(toolbar);
|
getDelegate().setSupportActionBar(toolbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MenuInflater getMenuInflater() {
|
public MenuInflater getMenuInflater()
|
||||||
|
{
|
||||||
return getDelegate().getMenuInflater();
|
return getDelegate().getMenuInflater();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setContentView(@LayoutRes int layoutResID) {
|
public void setContentView(@LayoutRes int layoutResID)
|
||||||
|
{
|
||||||
getDelegate().setContentView(layoutResID);
|
getDelegate().setContentView(layoutResID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,51 +63,61 @@ public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
public void setContentView(View view, ViewGroup.LayoutParams params)
|
||||||
|
{
|
||||||
getDelegate().setContentView(view, params);
|
getDelegate().setContentView(view, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addContentView(View view, ViewGroup.LayoutParams params) {
|
public void addContentView(View view, ViewGroup.LayoutParams params)
|
||||||
|
{
|
||||||
getDelegate().addContentView(view, params);
|
getDelegate().addContentView(view, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostResume() {
|
protected void onPostResume()
|
||||||
|
{
|
||||||
super.onPostResume();
|
super.onPostResume();
|
||||||
getDelegate().onPostResume();
|
getDelegate().onPostResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onTitleChanged(CharSequence title, int color) {
|
protected void onTitleChanged(CharSequence title, int color)
|
||||||
|
{
|
||||||
super.onTitleChanged(title, color);
|
super.onTitleChanged(title, color);
|
||||||
getDelegate().setTitle(title);
|
getDelegate().setTitle(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig)
|
||||||
|
{
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
getDelegate().onConfigurationChanged(newConfig);
|
getDelegate().onConfigurationChanged(newConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop()
|
||||||
|
{
|
||||||
super.onStop();
|
super.onStop();
|
||||||
getDelegate().onStop();
|
getDelegate().onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy()
|
||||||
|
{
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
getDelegate().onDestroy();
|
getDelegate().onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void invalidateOptionsMenu() {
|
public void invalidateOptionsMenu()
|
||||||
|
{
|
||||||
getDelegate().invalidateOptionsMenu();
|
getDelegate().invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
private AppCompatDelegate getDelegate() {
|
private AppCompatDelegate getDelegate()
|
||||||
if (mDelegate == null) {
|
{
|
||||||
|
if (mDelegate == null)
|
||||||
|
{
|
||||||
mDelegate = AppCompatDelegate.create(this, null);
|
mDelegate = AppCompatDelegate.create(this, null);
|
||||||
}
|
}
|
||||||
return mDelegate;
|
return mDelegate;
|
||||||
|
|||||||
@ -15,42 +15,47 @@ import android.widget.LinearLayout;
|
|||||||
|
|
||||||
import static android.graphics.Paint.ANTI_ALIAS_FLAG;
|
import static android.graphics.Paint.ANTI_ALIAS_FLAG;
|
||||||
|
|
||||||
public class IconBuilderPreview extends View {
|
public class IconBuilderPreview extends View
|
||||||
|
{
|
||||||
|
|
||||||
int mode;
|
private int mode;
|
||||||
int textSize;
|
private int textSize;
|
||||||
boolean fakeBold;
|
private boolean fakeBold;
|
||||||
int textColor;
|
private int textColor;
|
||||||
|
|
||||||
public IconBuilderPreview(Context context) {
|
public IconBuilderPreview(Context context)
|
||||||
|
{
|
||||||
super(context);
|
super(context);
|
||||||
initValues();
|
initValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IconBuilderPreview(Context context, @Nullable AttributeSet attrs) {
|
public IconBuilderPreview(Context context, @Nullable AttributeSet attrs)
|
||||||
|
{
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
initValues();
|
initValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IconBuilderPreview(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
public IconBuilderPreview(Context context, @Nullable AttributeSet attrs, int defStyleAttr)
|
||||||
|
{
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
initValues();
|
initValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IconBuilderPreview(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
public IconBuilderPreview(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes)
|
||||||
|
{
|
||||||
super(context, attrs, defStyleAttr, defStyleRes);
|
super(context, attrs, defStyleAttr, defStyleRes);
|
||||||
initValues();
|
initValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initValues()
|
private void initValues()
|
||||||
{
|
{
|
||||||
textSize = 48 * 10;
|
textSize = 48 * 10;
|
||||||
fakeBold = true;
|
fakeBold = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDraw(Canvas canvas) {
|
protected void onDraw(Canvas canvas)
|
||||||
|
{
|
||||||
super.onDraw(canvas);
|
super.onDraw(canvas);
|
||||||
mode = 2;
|
mode = 2;
|
||||||
fakeBold = true;
|
fakeBold = true;
|
||||||
@ -102,35 +107,43 @@ public class IconBuilderPreview extends View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMode() {
|
public int getMode()
|
||||||
|
{
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTextSize() {
|
public int getTextSize()
|
||||||
|
{
|
||||||
return textSize;
|
return textSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFakeBold() {
|
public boolean isFakeBold()
|
||||||
|
{
|
||||||
return fakeBold;
|
return fakeBold;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTextColor() {
|
public int getTextColor()
|
||||||
|
{
|
||||||
return textColor;
|
return textColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMode(int mode) {
|
public void setMode(int mode)
|
||||||
|
{
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTextSize(int textSize) {
|
public void setTextSize(int textSize)
|
||||||
|
{
|
||||||
this.textSize = textSize * 10;
|
this.textSize = textSize * 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFakeBold(boolean fakeBold) {
|
public void setFakeBold(boolean fakeBold)
|
||||||
|
{
|
||||||
this.fakeBold = fakeBold;
|
this.fakeBold = fakeBold;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTextColor(int textColor) {
|
public void setTextColor(int textColor)
|
||||||
|
{
|
||||||
this.textColor = textColor;
|
this.textColor = textColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import android.app.NotificationManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
@ -23,21 +24,26 @@ import android.view.accessibility.AccessibilityEvent;
|
|||||||
import static android.graphics.Paint.ANTI_ALIAS_FLAG;
|
import static android.graphics.Paint.ANTI_ALIAS_FLAG;
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("SuspiciousNameCombination")
|
||||||
public class IconService extends AccessibilityService
|
public class IconService extends AccessibilityService
|
||||||
implements SharedPreferences.OnSharedPreferenceChangeListener{
|
implements SharedPreferences.OnSharedPreferenceChangeListener
|
||||||
|
{
|
||||||
|
|
||||||
public String TAG = "layicon";
|
public static final String TAG = "layicon";
|
||||||
|
public static final String channelId = "space.neothefox.laytray.IC";
|
||||||
private final AccessibilityServiceInfo serviceInfo = new AccessibilityServiceInfo();
|
private final AccessibilityServiceInfo serviceInfo = new AccessibilityServiceInfo();
|
||||||
|
|
||||||
SharedPreferences layouts;
|
private SharedPreferences layouts;
|
||||||
SharedPreferences options;
|
private SharedPreferences iconsPrefs;
|
||||||
String lastToast;
|
private SharedPreferences options;
|
||||||
|
private String lastToast;
|
||||||
|
|
||||||
NotificationManager iconManager;
|
private NotificationManager iconManager;
|
||||||
NotificationChannel iconChannel;
|
private NotificationChannel iconChannel;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onServiceConnected() {
|
protected void onServiceConnected()
|
||||||
|
{
|
||||||
super.onServiceConnected();
|
super.onServiceConnected();
|
||||||
Log.d(TAG, "Icon service started");
|
Log.d(TAG, "Icon service started");
|
||||||
serviceInfo.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
|
serviceInfo.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
|
||||||
@ -46,54 +52,80 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|||||||
serviceInfo.notificationTimeout = 100;
|
serviceInfo.notificationTimeout = 100;
|
||||||
this.setServiceInfo(serviceInfo);
|
this.setServiceInfo(serviceInfo);
|
||||||
layouts = getSharedPreferences("layouts", 0);
|
layouts = getSharedPreferences("layouts", 0);
|
||||||
|
iconsPrefs = getSharedPreferences("icons", 0);
|
||||||
options = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
options = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
lastToast = "EMPT";
|
lastToast = "EMPT";
|
||||||
//options.registerOnSharedPreferenceChangeListener(this);
|
options.registerOnSharedPreferenceChangeListener(this);
|
||||||
|
|
||||||
iconManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
iconManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
iconChannel = new NotificationChannel(
|
{
|
||||||
"laytray",
|
try
|
||||||
"LayTray",
|
{
|
||||||
Integer.parseInt(options.getString("notificationImportance", "0")));
|
iconChannel = iconManager.getNotificationChannel(channelId);
|
||||||
iconChannel.setShowBadge(false);
|
}
|
||||||
iconChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
|
catch (NullPointerException e)
|
||||||
|
{
|
||||||
|
Log.d(TAG, "No NotificationChannel found");
|
||||||
|
}
|
||||||
|
if(iconChannel == null) {
|
||||||
|
iconChannel = new NotificationChannel(
|
||||||
|
channelId,
|
||||||
|
getString(R.string.title_icon_channel),
|
||||||
|
NotificationManager.IMPORTANCE_LOW);
|
||||||
|
iconChannel.setShowBadge(false);
|
||||||
|
iconChannel.enableLights(false);
|
||||||
|
iconChannel.enableVibration(false);
|
||||||
|
iconChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
|
||||||
|
iconManager.createNotificationChannel(iconChannel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateNotification(String toast)
|
private void updateNotification(String toast)
|
||||||
{
|
{
|
||||||
Notification indicator;
|
Notification indicator;
|
||||||
String textIcon = layouts.getString(toast,"EMPT");
|
String textIcon = layouts.getString(toast,"EMPT");
|
||||||
if(textIcon == "EMPT")
|
if(textIcon.equals("EMPT"))
|
||||||
{
|
{
|
||||||
SharedPreferences.Editor layoutsEditor = layouts.edit();
|
SharedPreferences.Editor layoutsEditor = layouts.edit();
|
||||||
layoutsEditor.putString(toast, "??");
|
layoutsEditor.putString(toast, "??");
|
||||||
layoutsEditor.commit();
|
layoutsEditor.apply();
|
||||||
textIcon = "??";
|
textIcon = "??";
|
||||||
}
|
}
|
||||||
Icon smallIcon = Icon.createWithBitmap(textAsBitmap(textIcon,
|
|
||||||
Integer.parseInt(options.getString("textSize", "48")),
|
Icon smallIcon;
|
||||||
options.getBoolean("textFakeBold", true),
|
|
||||||
Integer.parseInt(options.getString("textMode", "0")),
|
if (Integer.parseInt(options.getString("textMode", "0")) == 4) {
|
||||||
Color.WHITE));
|
// Icon selected
|
||||||
|
smallIcon = Icon.createWithResource(this, iconsPrefs.getInt(toast, R.drawable.ic_language_default));
|
||||||
|
} else {
|
||||||
|
// Text variations
|
||||||
|
smallIcon = Icon.createWithBitmap(textAsBitmap(textIcon,
|
||||||
|
Integer.parseInt(options.getString("textSize", "48")),
|
||||||
|
options.getBoolean("textFakeBold", true),
|
||||||
|
Integer.parseInt(options.getString("textMode", "0")),
|
||||||
|
Color.WHITE));
|
||||||
|
}
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
{
|
{
|
||||||
iconChannel.setImportance(
|
indicator = new Notification.Builder(this, channelId)
|
||||||
Integer.parseInt(options.getString("notificationImportance", "0")));
|
|
||||||
indicator = new Notification.Builder(this, "laytray")
|
|
||||||
.setSmallIcon(smallIcon)
|
.setSmallIcon(smallIcon)
|
||||||
.setContentTitle(toast)
|
.setContentTitle(toast)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
|
.setVisibility(Notification.VISIBILITY_SECRET)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
indicator = new Notification.Builder(this)
|
indicator = new Notification.Builder(this)
|
||||||
.setSmallIcon(smallIcon)
|
.setSmallIcon(smallIcon)
|
||||||
.setContentTitle(toast)
|
.setContentTitle(toast)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setPriority(Integer.parseInt(options.getString("notificationImportance", "0")))
|
.setPriority(Integer.parseInt(options.getString("notificationImportance", "0")))
|
||||||
|
.setVisibility(Notification.VISIBILITY_SECRET)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
iconManager.notify(0, indicator);
|
iconManager.notify(0, indicator);
|
||||||
@ -101,7 +133,8 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Borrowed from Ted Hopp from StackOverflow
|
//Borrowed from Ted Hopp from StackOverflow
|
||||||
public static Bitmap textAsBitmap(String text, float textSize, boolean fakeBold, int mode, int textColor) {
|
public static Bitmap textAsBitmap(String text, float textSize, boolean fakeBold, int mode, int textColor)
|
||||||
|
{
|
||||||
Paint paint = new Paint(ANTI_ALIAS_FLAG);
|
Paint paint = new Paint(ANTI_ALIAS_FLAG);
|
||||||
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT));
|
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT));
|
||||||
paint.setTextSize(textSize);
|
paint.setTextSize(textSize);
|
||||||
@ -119,7 +152,7 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|||||||
paint.setColor(Color.TRANSPARENT);
|
paint.setColor(Color.TRANSPARENT);
|
||||||
paint.setTextSize(textSize);
|
paint.setTextSize(textSize);
|
||||||
paint.setTextAlign(Paint.Align.CENTER);
|
paint.setTextAlign(Paint.Align.CENTER);
|
||||||
canvas.drawText(text, width / 2f, height / 2f + textSize / 2f, paint);
|
canvas.drawText(text, width/2f, ((height/2f) - (paint.descent()+paint.ascent())/2f), paint);
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +166,7 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|||||||
paint.setColor(Color.TRANSPARENT);
|
paint.setColor(Color.TRANSPARENT);
|
||||||
paint.setTextSize(textSize);
|
paint.setTextSize(textSize);
|
||||||
paint.setTextAlign(Paint.Align.CENTER);
|
paint.setTextAlign(Paint.Align.CENTER);
|
||||||
canvas.drawText(text, width / 2f, height / 2f + textSize / 2f, paint);
|
canvas.drawText(text, width / 2f, ((height/2f) - (paint.descent()+paint.ascent())/2f), paint);
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +182,7 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|||||||
paint.setColor(textColor);
|
paint.setColor(textColor);
|
||||||
paint.setTextSize(textSize);
|
paint.setTextSize(textSize);
|
||||||
paint.setTextAlign(Paint.Align.CENTER);
|
paint.setTextAlign(Paint.Align.CENTER);
|
||||||
canvas.drawText(text, width / 2f, height / 2f + textSize / 2f, paint);
|
canvas.drawText(text, width / 2f, ((height/2f) - (paint.descent()+paint.ascent())/2f), paint);
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +200,8 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAccessibilityEvent(AccessibilityEvent event) {
|
public void onAccessibilityEvent(AccessibilityEvent event)
|
||||||
|
{
|
||||||
|
|
||||||
Log.d(TAG, event.toString());
|
Log.d(TAG, event.toString());
|
||||||
if(event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED)
|
if(event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED)
|
||||||
@ -180,19 +214,18 @@ implements SharedPreferences.OnSharedPreferenceChangeListener{
|
|||||||
updateNotification(lastToast);
|
updateNotification(lastToast);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
Log.d(TAG, "Caution! This service had been tampered with!");
|
Log.d(TAG, "Caution! This service had been tampered with!");
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInterrupt() {
|
public void onInterrupt()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
|
||||||
|
{
|
||||||
options = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
options = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
updateNotification(lastToast);
|
updateNotification(lastToast);
|
||||||
}
|
}
|
||||||
|
|||||||
56
app/src/main/java/space/neothefox/laytray/IconsAdapter.java
Normal file
56
app/src/main/java/space/neothefox/laytray/IconsAdapter.java
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package space.neothefox.laytray;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
|
||||||
|
public class IconsAdapter extends BaseAdapter {
|
||||||
|
private Context context;
|
||||||
|
private int flags[];
|
||||||
|
private LayoutInflater inflter;
|
||||||
|
|
||||||
|
public IconsAdapter(Context applicationContext, int[] flags) {
|
||||||
|
this.context = applicationContext;
|
||||||
|
this.flags = flags;
|
||||||
|
inflter = (LayoutInflater.from(applicationContext));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return flags.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getItem(int i) {
|
||||||
|
return flags[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int i) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPosition(int value) {
|
||||||
|
int position = -1;
|
||||||
|
for (int i = 0; i < flags.length; i++) {
|
||||||
|
if (value == flags[i]) {
|
||||||
|
position = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int i, View convertView, ViewGroup parent) {
|
||||||
|
convertView = inflter.inflate(R.layout.spinner_item, null);
|
||||||
|
ImageView icon = (ImageView) convertView.findViewById(R.id.imageView);
|
||||||
|
icon.setImageResource(flags[i]);
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,58 +1,76 @@
|
|||||||
package space.neothefox.laytray;
|
package space.neothefox.laytray;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.AdapterView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.util.Log;
|
|
||||||
import android.widget.Space;
|
import android.widget.Space;
|
||||||
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity
|
public class MainActivity extends AppCompatActivity
|
||||||
implements View.OnClickListener, SharedPreferences.OnSharedPreferenceChangeListener {
|
implements View.OnClickListener, DialogInterface.OnClickListener, SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
LinearLayout layoutLister;
|
public final String TAG = "layiconActivity";
|
||||||
SharedPreferences layouts;
|
|
||||||
public String TAG = "layiconActivity";
|
private LinearLayout layoutLister;
|
||||||
|
private SharedPreferences layouts;
|
||||||
|
private SharedPreferences iconsPrefs;
|
||||||
|
private boolean shouldRefresh = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
layoutLister = findViewById(R.id.scrollLinearLayout);
|
layoutLister = findViewById(R.id.scrollLinearLayout);
|
||||||
layouts = getSharedPreferences("layouts", 0);
|
layouts = getSharedPreferences("layouts", 0);
|
||||||
|
iconsPrefs = getSharedPreferences("icons", 0);
|
||||||
updateLayouts();
|
updateLayouts();
|
||||||
|
|
||||||
FloatingActionButton addButton = findViewById(R.id.floatingActionButton);
|
FloatingActionButton addButton = findViewById(R.id.floatingActionButton);
|
||||||
addButton.setOnClickListener(this);
|
addButton.setOnClickListener(this);
|
||||||
layouts.registerOnSharedPreferenceChangeListener(this);
|
layouts.registerOnSharedPreferenceChangeListener(this);
|
||||||
|
|
||||||
if (!isAccessibilitySettingsOn(getApplicationContext())) {
|
if (!isAccessibilitySettingsOn(getApplicationContext()))
|
||||||
|
{
|
||||||
Toast.makeText(this, R.string.toast_enableme,
|
Toast.makeText(this, R.string.toast_enableme,
|
||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));
|
startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!isPackageInstalled("com.blackberry.keyboard", getApplicationContext().getPackageManager()) && !BuildConfig.DEBUG)
|
||||||
|
{
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
builder.setTitle(R.string.unsupported_device)
|
||||||
|
.setMessage(R.string.unsupported_device_description)
|
||||||
|
.setNeutralButton(R.string.close, this)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateLayouts()
|
private void updateLayouts()
|
||||||
{
|
{
|
||||||
layoutLister.removeAllViewsInLayout();
|
layoutLister.removeAllViewsInLayout();
|
||||||
|
|
||||||
@ -62,43 +80,46 @@ implements View.OnClickListener, SharedPreferences.OnSharedPreferenceChangeListe
|
|||||||
{
|
{
|
||||||
Log.d(TAG, "listing map:");
|
Log.d(TAG, "listing map:");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(Map.Entry<String,?> entry : keys.entrySet()){
|
for(Map.Entry<String,?> entry : keys.entrySet())
|
||||||
|
{
|
||||||
Log.d("map values",entry.getKey() + ": " +
|
Log.d("map values",entry.getKey() + ": " +
|
||||||
entry.getValue().toString());
|
entry.getValue().toString());
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
if(entry.getKey() != "EMPT")
|
if(!entry.getKey().equals("EMPT")) {
|
||||||
addLine(layoutLister, entry.getKey(), entry.getValue().toString());
|
addLine(
|
||||||
|
layoutLister, entry.getKey(),
|
||||||
|
entry.getValue().toString(),
|
||||||
|
iconsPrefs.getInt(entry.getKey(), R.drawable.ic_language_default)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(i == 0)
|
if(i == 0)
|
||||||
{
|
|
||||||
populateLayouts();
|
populateLayouts();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
populateLayouts();
|
populateLayouts();
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void populateLayouts()
|
private void populateLayouts()
|
||||||
{
|
{
|
||||||
Log.d("map values", "Shared Prefs are empty");
|
Log.d("map values", "Shared Prefs are empty");
|
||||||
SharedPreferences.Editor layoutsEditor = layouts.edit();
|
SharedPreferences.Editor layoutsEditor = layouts.edit();
|
||||||
|
SharedPreferences.Editor iconsEditor = iconsPrefs.edit();
|
||||||
|
iconsEditor.clear();
|
||||||
layoutsEditor.clear();
|
layoutsEditor.clear();
|
||||||
layoutsEditor.putString("Русский", "RU");
|
layoutsEditor.putString("Русский", "RU");
|
||||||
layoutsEditor.putString("Буквы (АБВ)", "EN");
|
layoutsEditor.putString("Буквы (АБВ)", "EN");
|
||||||
layoutsEditor.putString("EMPT", "??");
|
layoutsEditor.putString("EMPT", "??");
|
||||||
layoutsEditor.commit();
|
|
||||||
|
shouldRefresh = false;
|
||||||
|
iconsEditor.apply();
|
||||||
|
shouldRefresh = true;
|
||||||
|
layoutsEditor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addLine(LinearLayout parent)
|
private void addLine(LinearLayout parent, String name, String icon, int iconDrawableId)
|
||||||
{
|
|
||||||
addLine(parent, "Name", "ICO");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void addLine(LinearLayout parent, String name, String icon)
|
|
||||||
{
|
{
|
||||||
final LinearLayout layoutLine = new LinearLayout(getApplicationContext());
|
final LinearLayout layoutLine = new LinearLayout(getApplicationContext());
|
||||||
layoutLine.setOrientation(LinearLayout.HORIZONTAL);
|
layoutLine.setOrientation(LinearLayout.HORIZONTAL);
|
||||||
@ -117,18 +138,38 @@ implements View.OnClickListener, SharedPreferences.OnSharedPreferenceChangeListe
|
|||||||
layoutIcon.setText(icon);
|
layoutIcon.setText(icon);
|
||||||
layoutLine.addView(layoutIcon);
|
layoutLine.addView(layoutIcon);
|
||||||
|
|
||||||
|
|
||||||
|
// Icons Dropdown
|
||||||
|
final int[] iconFlags = {
|
||||||
|
R.drawable.ic_language_default,
|
||||||
|
R.drawable.ic_flag_russia,
|
||||||
|
R.drawable.ic_flag_gb,
|
||||||
|
R.drawable.ic_flag_belarus,
|
||||||
|
R.drawable.ic_flag_ukr
|
||||||
|
};
|
||||||
|
IconsAdapter arrayAdapter = new IconsAdapter(this, iconFlags);
|
||||||
|
final Spinner iconSpinner = new Spinner(this);
|
||||||
|
iconSpinner.setAdapter(arrayAdapter);
|
||||||
|
iconSpinner.setSelection(arrayAdapter.getPosition(iconDrawableId));
|
||||||
|
layoutLine.addView(iconSpinner);
|
||||||
|
iconSpinner.setSelection(arrayAdapter.getPosition(iconDrawableId));
|
||||||
|
|
||||||
|
|
||||||
Space space = new Space(getApplicationContext());
|
Space space = new Space(getApplicationContext());
|
||||||
space.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
space.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT, 2));
|
ViewGroup.LayoutParams.MATCH_PARENT, 2));
|
||||||
layoutLine.addView(space);
|
layoutLine.addView(space);
|
||||||
|
|
||||||
|
|
||||||
final Button removeButton = new Button(getApplicationContext());
|
final Button removeButton = new Button(getApplicationContext());
|
||||||
removeButton.setText("➖");
|
removeButton.setText("➖");
|
||||||
removeButton.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
|
removeButton.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT));
|
ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||||
removeButton.setOnClickListener(new View.OnClickListener() {
|
removeButton.setOnClickListener(new View.OnClickListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v)
|
||||||
|
{
|
||||||
LinearLayout daddy = (LinearLayout)removeButton.getParent();
|
LinearLayout daddy = (LinearLayout)removeButton.getParent();
|
||||||
LinearLayout grandpa = (LinearLayout)daddy.getParent();
|
LinearLayout grandpa = (LinearLayout)daddy.getParent();
|
||||||
daddy.removeAllViewsInLayout();
|
daddy.removeAllViewsInLayout();
|
||||||
@ -140,97 +181,118 @@ implements View.OnClickListener, SharedPreferences.OnSharedPreferenceChangeListe
|
|||||||
parent.addView(layoutLine);
|
parent.addView(layoutLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void saveLayouts(LinearLayout parent)
|
private void saveLayouts(LinearLayout parent)
|
||||||
{
|
{
|
||||||
int count = parent.getChildCount();
|
int count = parent.getChildCount();
|
||||||
Log.d(TAG, String.format("%d layouts to save", count));
|
Log.d(TAG, String.format("%d layouts to save", count));
|
||||||
if (count != 0)
|
if (count != 0)
|
||||||
{
|
{
|
||||||
SharedPreferences.Editor layoutsEditor = layouts.edit();
|
SharedPreferences.Editor layoutsEditor = layouts.edit();
|
||||||
|
SharedPreferences.Editor iconsEditor = iconsPrefs.edit();
|
||||||
layoutsEditor.clear();
|
layoutsEditor.clear();
|
||||||
|
iconsEditor.clear();
|
||||||
for (int i=0; i < count; i++)
|
for (int i=0; i < count; i++)
|
||||||
{
|
{
|
||||||
LinearLayout layoutLine = (LinearLayout)parent.getChildAt(i);
|
LinearLayout layoutLine = (LinearLayout)parent.getChildAt(i);
|
||||||
TextView layoutName = (TextView)layoutLine.getChildAt(0);
|
TextView layoutName = (TextView)layoutLine.getChildAt(0);
|
||||||
EditText layoutIcon = (EditText)layoutLine.getChildAt(1);
|
EditText layoutIcon = (EditText)layoutLine.getChildAt(1);
|
||||||
|
Spinner layoutDropdown = (Spinner)layoutLine.getChildAt(2);
|
||||||
String layoutNameValue = layoutName.getText().toString();
|
String layoutNameValue = layoutName.getText().toString();
|
||||||
String layoutIconValue = layoutIcon.getText().toString();
|
String layoutIconValue = layoutIcon.getText().toString();
|
||||||
if(layoutNameValue != "")
|
int layoutDropdownValue = (int)layoutDropdown.getSelectedItem();
|
||||||
|
if(!layoutNameValue.equals(""))
|
||||||
{
|
{
|
||||||
if(layoutIconValue != "")
|
if(!layoutIconValue.equals("")) {
|
||||||
{
|
|
||||||
layoutsEditor.putString(layoutNameValue, layoutIconValue);
|
layoutsEditor.putString(layoutNameValue, layoutIconValue);
|
||||||
}
|
iconsEditor.putInt(layoutNameValue, layoutDropdownValue);
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
layoutsEditor.putString(layoutNameValue, "??");
|
layoutsEditor.putString(layoutNameValue, "??");
|
||||||
|
iconsEditor.putInt(layoutNameValue, layoutDropdownValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
layoutsEditor.commit();
|
shouldRefresh = false;
|
||||||
|
iconsEditor.apply();
|
||||||
|
shouldRefresh = true;
|
||||||
|
layoutsEditor.apply();
|
||||||
|
} else {
|
||||||
|
populateLayouts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Accessibility check by Antoine Bolvy
|
//Accessibility check by Antoine Bolvy
|
||||||
private boolean isAccessibilitySettingsOn(Context mContext) {
|
private boolean isAccessibilitySettingsOn(Context mContext)
|
||||||
|
{
|
||||||
int accessibilityEnabled = 0;
|
int accessibilityEnabled = 0;
|
||||||
final String service = getPackageName() + "/" + IconService.class.getCanonicalName();
|
final String service = getPackageName() + "/" + IconService.class.getCanonicalName();
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
accessibilityEnabled = Settings.Secure.getInt(
|
accessibilityEnabled = Settings.Secure.getInt(
|
||||||
mContext.getApplicationContext().getContentResolver(),
|
mContext.getApplicationContext().getContentResolver(),
|
||||||
android.provider.Settings.Secure.ACCESSIBILITY_ENABLED);
|
android.provider.Settings.Secure.ACCESSIBILITY_ENABLED);
|
||||||
Log.v(TAG, "accessibilityEnabled = " + accessibilityEnabled);
|
Log.v(TAG, "accessibilityEnabled = " + accessibilityEnabled);
|
||||||
} catch (Settings.SettingNotFoundException e) {
|
}
|
||||||
|
catch (Settings.SettingNotFoundException e)
|
||||||
|
{
|
||||||
Log.e(TAG, "Error finding setting, default accessibility to not found: "
|
Log.e(TAG, "Error finding setting, default accessibility to not found: "
|
||||||
+ e.getMessage());
|
+ e.getMessage());
|
||||||
}
|
}
|
||||||
TextUtils.SimpleStringSplitter mStringColonSplitter = new TextUtils.SimpleStringSplitter(':');
|
TextUtils.SimpleStringSplitter mStringColonSplitter = new TextUtils.SimpleStringSplitter(':');
|
||||||
|
|
||||||
if (accessibilityEnabled == 1) {
|
if (accessibilityEnabled == 1)
|
||||||
|
{
|
||||||
Log.v(TAG, "Accessibility service enabled");
|
Log.v(TAG, "Accessibility service enabled");
|
||||||
String settingValue = Settings.Secure.getString(
|
String settingValue = Settings.Secure.getString(
|
||||||
mContext.getApplicationContext().getContentResolver(),
|
mContext.getApplicationContext().getContentResolver(),
|
||||||
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
|
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
|
||||||
if (settingValue != null) {
|
if (settingValue != null)
|
||||||
|
{
|
||||||
mStringColonSplitter.setString(settingValue);
|
mStringColonSplitter.setString(settingValue);
|
||||||
while (mStringColonSplitter.hasNext()) {
|
while (mStringColonSplitter.hasNext())
|
||||||
|
{
|
||||||
String accessibilityService = mStringColonSplitter.next();
|
String accessibilityService = mStringColonSplitter.next();
|
||||||
|
|
||||||
Log.v(TAG, "-------------- > accessibilityService :: " + accessibilityService + " " + service);
|
Log.v(TAG, "-------------- > accessibilityService :: " + accessibilityService + " " + service);
|
||||||
if (accessibilityService.equalsIgnoreCase(service)) {
|
if (accessibilityService.equalsIgnoreCase(service))
|
||||||
|
{
|
||||||
Log.v(TAG, "We've found the correct setting - accessibility is switched on!");
|
Log.v(TAG, "We've found the correct setting - accessibility is switched on!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Log.v(TAG, "Accessibility is disabled");
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
Log.v(TAG, "Accessibility is disabled");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v)
|
||||||
|
{
|
||||||
switch(v.getId())
|
switch(v.getId())
|
||||||
{
|
{
|
||||||
case R.id.floatingActionButton:
|
case R.id.floatingActionButton:
|
||||||
saveLayouts(layoutLister);
|
saveLayouts(layoutLister);
|
||||||
|
Toast.makeText(this, R.string.toast_saved,
|
||||||
|
Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu)
|
||||||
|
{
|
||||||
MenuInflater inflater = getMenuInflater();
|
MenuInflater inflater = getMenuInflater();
|
||||||
inflater.inflate(R.menu.menu, menu);
|
inflater.inflate(R.menu.menu, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item)
|
||||||
|
{
|
||||||
switch(item.getItemId())
|
switch(item.getItemId())
|
||||||
{
|
{
|
||||||
case R.id.settings:
|
case R.id.settings:
|
||||||
@ -245,9 +307,32 @@ implements View.OnClickListener, SharedPreferences.OnSharedPreferenceChangeListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
|
||||||
layouts = getSharedPreferences("layouts", 0);
|
{
|
||||||
updateLayouts();
|
if (shouldRefresh) {
|
||||||
|
layouts = getSharedPreferences("layouts", 0);
|
||||||
|
iconsPrefs = getSharedPreferences("icons", 0);
|
||||||
|
updateLayouts();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isPackageInstalled(String packageName, PackageManager packageManager)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
packageManager.getPackageInfo(packageName, 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (PackageManager.NameNotFoundException e)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i)
|
||||||
|
{
|
||||||
|
//There is only one potential dialog
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,23 +6,20 @@ import android.app.FragmentManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.media.Ringtone;
|
|
||||||
import android.media.RingtoneManager;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.ListPreference;
|
import android.preference.ListPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v7.app.ActionBar;
|
|
||||||
import android.preference.PreferenceFragment;
|
import android.preference.PreferenceFragment;
|
||||||
|
import android.preference.PreferenceGroup;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.preference.RingtonePreference;
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.app.NavUtils;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.support.v4.app.NavUtils;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@ -41,7 +38,8 @@ import java.util.List;
|
|||||||
* href="http://developer.android.com/guide/topics/ui/settings.html">Settings
|
* href="http://developer.android.com/guide/topics/ui/settings.html">Settings
|
||||||
* API Guide</a> for more information on developing a Settings UI.
|
* API Guide</a> for more information on developing a Settings UI.
|
||||||
*/
|
*/
|
||||||
public class SettingsActivity extends AppCompatPreferenceActivity {
|
public class SettingsActivity extends AppCompatPreferenceActivity
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A preference value change listener that updates the preference's summary
|
* A preference value change listener that updates the preference's summary
|
||||||
@ -49,10 +47,12 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
*/
|
*/
|
||||||
private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
|
private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceChange(Preference preference, Object value) {
|
public boolean onPreferenceChange(Preference preference, Object value)
|
||||||
|
{
|
||||||
String stringValue = value.toString();
|
String stringValue = value.toString();
|
||||||
|
|
||||||
if (preference instanceof ListPreference) {
|
if (preference instanceof ListPreference)
|
||||||
|
{
|
||||||
// For list preferences, look up the correct display value in
|
// For list preferences, look up the correct display value in
|
||||||
// the preference's 'entries' list.
|
// the preference's 'entries' list.
|
||||||
ListPreference listPreference = (ListPreference) preference;
|
ListPreference listPreference = (ListPreference) preference;
|
||||||
@ -64,7 +64,9 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
? listPreference.getEntries()[index]
|
? listPreference.getEntries()[index]
|
||||||
: null);
|
: null);
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// For all other preferences, set the summary to the value's
|
// For all other preferences, set the summary to the value's
|
||||||
// simple string representation.
|
// simple string representation.
|
||||||
preference.setSummary(stringValue);
|
preference.setSummary(stringValue);
|
||||||
@ -77,7 +79,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
* Helper method to determine if the device has an extra-large screen. For
|
* Helper method to determine if the device has an extra-large screen. For
|
||||||
* example, 10" tablets are extra-large.
|
* example, 10" tablets are extra-large.
|
||||||
*/
|
*/
|
||||||
private static boolean isXLargeTablet(Context context) {
|
private static boolean isXLargeTablet(Context context)
|
||||||
|
{
|
||||||
return (context.getResources().getConfiguration().screenLayout
|
return (context.getResources().getConfiguration().screenLayout
|
||||||
& Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
& Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
||||||
}
|
}
|
||||||
@ -91,7 +94,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
*
|
*
|
||||||
* @see #sBindPreferenceSummaryToValueListener
|
* @see #sBindPreferenceSummaryToValueListener
|
||||||
*/
|
*/
|
||||||
private static void bindPreferenceSummaryToValue(Preference preference) {
|
private static void bindPreferenceSummaryToValue(Preference preference)
|
||||||
|
{
|
||||||
// Set the listener to watch for value changes.
|
// Set the listener to watch for value changes.
|
||||||
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
|
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
|
||||||
|
|
||||||
@ -104,7 +108,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setupActionBar();
|
setupActionBar();
|
||||||
}
|
}
|
||||||
@ -112,19 +117,24 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
/**
|
/**
|
||||||
* Set up the {@link android.app.ActionBar}, if the API is available.
|
* Set up the {@link android.app.ActionBar}, if the API is available.
|
||||||
*/
|
*/
|
||||||
private void setupActionBar() {
|
private void setupActionBar()
|
||||||
|
{
|
||||||
ActionBar actionBar = getSupportActionBar();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
if (actionBar != null) {
|
if (actionBar != null)
|
||||||
|
{
|
||||||
// Show the Up button in the action bar.
|
// Show the Up button in the action bar.
|
||||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemSelected(int featureId, MenuItem item) {
|
public boolean onMenuItemSelected(int featureId, MenuItem item)
|
||||||
|
{
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home)
|
||||||
if (!super.onMenuItemSelected(featureId, item)) {
|
{
|
||||||
|
if (!super.onMenuItemSelected(featureId, item))
|
||||||
|
{
|
||||||
NavUtils.navigateUpFromSameTask(this);
|
NavUtils.navigateUpFromSameTask(this);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -136,7 +146,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onIsMultiPane() {
|
public boolean onIsMultiPane()
|
||||||
|
{
|
||||||
return isXLargeTablet(this);
|
return isXLargeTablet(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +156,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
public void onBuildHeaders(List<Header> target) {
|
public void onBuildHeaders(List<Header> target)
|
||||||
|
{
|
||||||
loadHeadersFromResource(R.xml.pref_headers, target);
|
loadHeadersFromResource(R.xml.pref_headers, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +165,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
* This method stops fragment injection in malicious applications.
|
* This method stops fragment injection in malicious applications.
|
||||||
* Make sure to deny any unknown fragments here.
|
* Make sure to deny any unknown fragments here.
|
||||||
*/
|
*/
|
||||||
protected boolean isValidFragment(String fragmentName) {
|
protected boolean isValidFragment(String fragmentName)
|
||||||
|
{
|
||||||
return PreferenceFragment.class.getName().equals(fragmentName)
|
return PreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| NotificationPreferenceFragment.class.getName().equals(fragmentName);
|
|| NotificationPreferenceFragment.class.getName().equals(fragmentName);
|
||||||
@ -164,9 +177,11 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
* activity is showing a two-pane settings UI.
|
* activity is showing a two-pane settings UI.
|
||||||
*/
|
*/
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
public static class GeneralPreferenceFragment extends PreferenceFragment {
|
public static class GeneralPreferenceFragment extends PreferenceFragment
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
addPreferencesFromResource(R.xml.pref_general);
|
addPreferencesFromResource(R.xml.pref_general);
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
@ -179,9 +194,11 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item)
|
||||||
|
{
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home)
|
||||||
|
{
|
||||||
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -194,9 +211,11 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
* activity is showing a two-pane settings UI.
|
* activity is showing a two-pane settings UI.
|
||||||
*/
|
*/
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
public static class NotificationPreferenceFragment extends PreferenceFragment {
|
public static class NotificationPreferenceFragment extends PreferenceFragment
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
addPreferencesFromResource(R.xml.pref_notification);
|
addPreferencesFromResource(R.xml.pref_notification);
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
@ -205,7 +224,32 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
// to their values. When their values change, their summaries are
|
// to their values. When their values change, their summaries are
|
||||||
// updated to reflect the new value, per the Android Design
|
// updated to reflect the new value, per the Android Design
|
||||||
// guidelines.
|
// guidelines.
|
||||||
bindPreferenceSummaryToValue(findPreference("notificationImportance"));
|
|
||||||
|
//With Oreo this setting should be set by the system dialog
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
|
{
|
||||||
|
Preference notificationImportance = getPreferenceScreen().findPreference("notificationImportance");
|
||||||
|
PreferenceGroup parent = notificationImportance.getParent();
|
||||||
|
parent.removePreference(notificationImportance);
|
||||||
|
Preference notificationImportanceOreo = new Preference(parent.getContext());
|
||||||
|
notificationImportanceOreo.setTitle(R.string.pref_title_notification_importance);
|
||||||
|
notificationImportanceOreo.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceClick(Preference preference)
|
||||||
|
{
|
||||||
|
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
|
||||||
|
intent.putExtra(Settings.EXTRA_APP_PACKAGE, "space.neothefox.laytray");
|
||||||
|
intent.putExtra(Settings.EXTRA_CHANNEL_ID, IconService.channelId);
|
||||||
|
startActivity(intent);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
parent.addPreference(notificationImportanceOreo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
bindPreferenceSummaryToValue(findPreference("notificationImportance"));
|
||||||
|
|
||||||
bindPreferenceSummaryToValue(findPreference("textMode"));
|
bindPreferenceSummaryToValue(findPreference("textMode"));
|
||||||
bindPreferenceSummaryToValue(findPreference("textSize"));
|
bindPreferenceSummaryToValue(findPreference("textSize"));
|
||||||
|
|
||||||
@ -223,7 +267,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
public static class IconBuilderPreferenceFragment extends DialogFragment implements View.OnClickListener {
|
public static class IconBuilderPreferenceFragment extends DialogFragment implements View.OnClickListener
|
||||||
|
{
|
||||||
|
|
||||||
SeekBar xBar;
|
SeekBar xBar;
|
||||||
VerticalSeekBar yBar;
|
VerticalSeekBar yBar;
|
||||||
@ -235,18 +280,18 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState)
|
||||||
View view = inflater.inflate(R.layout.fragment_icon_builder, container);
|
{
|
||||||
return view;
|
return inflater.inflate(R.layout.fragment_icon_builder, container);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
|
||||||
|
{
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
xBar = getView().findViewById(R.id.horSeekBar);
|
xBar = getView().findViewById(R.id.horSeekBar);
|
||||||
@ -263,8 +308,10 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v)
|
||||||
switch (v.getId()) {
|
{
|
||||||
|
switch (v.getId())
|
||||||
|
{
|
||||||
case R.id.saveButton:
|
case R.id.saveButton:
|
||||||
return;
|
return;
|
||||||
case R.id.closeButton:
|
case R.id.closeButton:
|
||||||
@ -275,9 +322,11 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item)
|
||||||
|
{
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home)
|
||||||
|
{
|
||||||
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,49 +1,59 @@
|
|||||||
package space.neothefox.laytray;
|
package space.neothefox.laytray;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
|
import android.support.v7.widget.AppCompatSeekBar;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.widget.SeekBar;
|
|
||||||
|
|
||||||
public class VerticalSeekBar extends SeekBar {
|
public class VerticalSeekBar extends AppCompatSeekBar
|
||||||
|
{
|
||||||
|
|
||||||
public VerticalSeekBar(Context context) {
|
public VerticalSeekBar(Context context)
|
||||||
|
{
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public VerticalSeekBar(Context context, AttributeSet attrs, int defStyle) {
|
public VerticalSeekBar(Context context, AttributeSet attrs, int defStyle)
|
||||||
|
{
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public VerticalSeekBar(Context context, AttributeSet attrs) {
|
public VerticalSeekBar(Context context, AttributeSet attrs)
|
||||||
|
{
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
protected void onSizeChanged(int w, int h, int oldw, int oldh)
|
||||||
|
{
|
||||||
super.onSizeChanged(h, w, oldh, oldw);
|
super.onSizeChanged(h, w, oldh, oldw);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
|
||||||
|
{
|
||||||
super.onMeasure(heightMeasureSpec, widthMeasureSpec);
|
super.onMeasure(heightMeasureSpec, widthMeasureSpec);
|
||||||
setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
|
setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onDraw(Canvas c) {
|
protected void onDraw(Canvas c)
|
||||||
|
{
|
||||||
c.rotate(-90);
|
c.rotate(-90);
|
||||||
c.translate(-getHeight(), 0);
|
c.translate(-getHeight(), 0);
|
||||||
|
|
||||||
super.onDraw(c);
|
super.onDraw(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouchEvent(MotionEvent event) {
|
public boolean onTouchEvent(MotionEvent event)
|
||||||
if (!isEnabled()) {
|
{
|
||||||
|
if (!isEnabled())
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
switch (event.getAction()) {
|
switch (event.getAction())
|
||||||
|
{
|
||||||
case MotionEvent.ACTION_DOWN:
|
case MotionEvent.ACTION_DOWN:
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
|
|||||||
6
app/src/main/res/drawable/ic_flag_belarus.xml
Normal file
6
app/src/main/res/drawable/ic_flag_belarus.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<vector android:height="24dp" android:viewportHeight="2"
|
||||||
|
android:viewportWidth="3" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#66000000" android:pathData="M0,1h3v0.75h-3z"/>
|
||||||
|
<path android:fillColor="#99000000" android:pathData="M0,0h3v1h-3z"/>
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M0,0h0.5v1.75h-3z"/>
|
||||||
|
</vector>
|
||||||
5
app/src/main/res/drawable/ic_flag_gb.xml
Normal file
5
app/src/main/res/drawable/ic_flag_gb.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="32dp" android:viewportHeight="25.1"
|
||||||
|
android:viewportWidth="40.9" android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M18,0h5v10h18v5H23.1a3,3 0,0 0,-0.3 0,0.6 0.6,0 0,0 0,0.2v9.9H18V15H0v-5h18a1,1 0,0 0,0 -0.1z"/>
|
||||||
|
<path android:fillColor="#99000000" android:pathData="M15.6,0v7a1.4,1.4 0,0 1,-0.3 -0.1L4.3,0.2 4.2,0zM36.7,0a2.8,2.8 0,0 1,-0.3 0.2L25.7,6.8l-0.4,0.3L25.3,0zM4.2,25a2,2 0,0 1,0.3 -0.1l10.8,-6.7 0.3,-0.2v7zM25.3,25v-6.9l0.3,0.1 10.9,6.7a1.6,1.6 0,0 1,0.2 0.2zM0,2.2l0.3,0.1 8.3,5.1v0.2L0,7.6zM41,7.6h-8.8l0.3,-0.2 8,-5a4,4 0,0 1,0.4 -0.2zM0,17.5h8.7a2.6,2.6 0,0 1,-0.2 0.2l-8.1,5a2.3,2.3 0,0 1,-0.4 0.2zM41,22.9a1.4,1.4 0,0 1,-0.3 -0.1l-8.3,-5.1 -0.1,-0.2h8.6z"/>
|
||||||
|
</vector>
|
||||||
6
app/src/main/res/drawable/ic_flag_russia.xml
Normal file
6
app/src/main/res/drawable/ic_flag_russia.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<vector android:height="24dp" android:viewportHeight="512.001"
|
||||||
|
android:viewportWidth="512.001" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M512,200.093H0V97.104c0,-4.875 3.953,-8.828 8.828,-8.828h494.345c4.875,0 8.828,3.953 8.828,8.828L512,200.093L512,200.093z"/>
|
||||||
|
<path android:fillColor="#88000000" android:pathData="M503.172,423.725H8.828c-4.875,0 -8.828,-3.953 -8.828,-8.828V311.909h512v102.988C512,419.773 508.047,423.725 503.172,423.725z"/>
|
||||||
|
<path android:fillColor="#22000000" android:pathData="M0,200.091h512v111.81h-512z"/>
|
||||||
|
</vector>
|
||||||
5
app/src/main/res/drawable/ic_flag_ukr.xml
Normal file
5
app/src/main/res/drawable/ic_flag_ukr.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:viewportHeight="2"
|
||||||
|
android:viewportWidth="3" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#88000000" android:pathData="M0,1h3v1h-3z"/>
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M0,0h3v1h-3z"/>
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/ic_language_default.xml
Normal file
9
app/src/main/res/drawable/ic_language_default.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"/>
|
||||||
|
</vector>
|
||||||
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
|
android:contentDescription="@string/title_icon_channel"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="138dp"
|
android:layout_marginEnd="138dp"
|
||||||
|
|||||||
@ -43,19 +43,10 @@
|
|||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
app:backgroundTint="?attr/colorPrimary"
|
app:backgroundTint="?attr/colorPrimary"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:srcCompat="@android:drawable/ic_menu_save" />
|
app:srcCompat="@android:drawable/ic_menu_save" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="by NeoTheFox"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
24
app/src/main/res/layout/spinner_item.xml
Normal file
24
app/src/main/res/layout/spinner_item.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@drawable/ic_info_black_24dp" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="0dp"
|
||||||
|
android:text="Icon"
|
||||||
|
android:textColor="#000" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
63
app/src/main/res/values-be/strings.xml
Normal file
63
app/src/main/res/values-be/strings.xml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="service_description">Простая іконка раскладкі</string>
|
||||||
|
<string name="accessibility_summary">LayTray патрабуе доступ да спецыяльных магчымасцяў каб праглядаць паведамленні ад клавіятуры. LayTray не адсочвае набіранне тэкста і не адпраўляе аніякай інфармацыі аб Вашай дзейнасці ў Інтэрнэт.</string>
|
||||||
|
<string name="activity_info">Дадайце скарочаныя назвы для раскладак</string>
|
||||||
|
<string name="title_activity_settings">Налады</string>
|
||||||
|
<string name="toast_enableme">Вы мусіце ўключыць сэрвіс!</string>
|
||||||
|
<string name="toast_saved">Захаваны</string>
|
||||||
|
|
||||||
|
<string name="pref_header_general">Агульныя</string>
|
||||||
|
|
||||||
|
<string name="pref_title_default_app_name">Прыкладанне для назірання</string>
|
||||||
|
<string-array name="pref_default_app_name_list_titles">
|
||||||
|
<item>Blackberry Keyboard</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_default_app_name_list_values">
|
||||||
|
<item>com.blackberry.keyboard</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="pref_title_notification_importance">Важнасць паведамлення</string>
|
||||||
|
<string-array name="pref_notification_importance_list_titles">
|
||||||
|
<item>Default</item>
|
||||||
|
<item>High</item>
|
||||||
|
<item>Low</item>
|
||||||
|
<item>Min</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_notification_importance_list_values">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
<item>-1</item>
|
||||||
|
<item>-2</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="pref_title_notification_mode">Форма іконкі</string>
|
||||||
|
<string-array name="pref_notification_mode_list_titles">
|
||||||
|
<item>Звычайны тэкст</item>
|
||||||
|
<item>Тэкст у крузе</item>
|
||||||
|
<item>Тэкст у квадраце</item>
|
||||||
|
<item>Тэкст у квадраце з абрысам</item>
|
||||||
|
<item>Іконка</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_notification_mode_list_values">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
<item>3</item>
|
||||||
|
<item>4</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="pref_title_icon_builder">Рэдактар іконак</string>
|
||||||
|
|
||||||
|
<!-- Example settings for Notifications -->
|
||||||
|
<string name="pref_header_notifications">Іконка</string>
|
||||||
|
|
||||||
|
<string name="pref_title_text_fake_bold">Тоўсты шрыфт</string>
|
||||||
|
<string name="pref_title_text_size">Памер тэксту</string>
|
||||||
|
|
||||||
|
<string name="title_about">Аб праграме</string>
|
||||||
|
<string name="close">Зачыніць</string>
|
||||||
|
<string name="unsupported_device">Тэлефон не падтрымліваецца</string>
|
||||||
|
<string name="title_icon_channel">Iконкa раскладкі</string>
|
||||||
|
<string name="unsupported_device_description">Гэты тэлефон не хапае клавіятуры BlackBerry. LayTray не будзе працаваць без яго.</string>
|
||||||
|
</resources>
|
||||||
64
app/src/main/res/values-cs/strings.xml
Normal file
64
app/src/main/res/values-cs/strings.xml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="service_description">Jednoduchá ikona rozvržení klávesnice</string>
|
||||||
|
<string name="accessibility_summary">LayTray je třeba zapnout v aplikaci zpřístupnění, protože jediný způsob, jak na Android zjistit rozvržení, je sledovat oznámení Toast. LayTray nemůže vidět co píšete a neodesílá žádná data o vaší aktivitě třetím stranám</string>
|
||||||
|
<string name="activity_info">Přiřadit název k ikoně rozvržení</string>
|
||||||
|
<string name="title_activity_settings">Nastavení</string>
|
||||||
|
<string name="toast_enableme">Je třeba službu zapnout!</string>
|
||||||
|
<string name="unsupported_device">Nepodporovaný telefon</string>
|
||||||
|
<string name="unsupported_device_description">Tento telefon postrádá BlackBerry klávesnici. LayTray bez ní nefunguje.</string>
|
||||||
|
<string name="close">Zavřít</string>
|
||||||
|
<string name="toast_saved">Uloženo</string>
|
||||||
|
<string name="title_icon_channel">Ikona rozvržení klávesnice</string>
|
||||||
|
<!-- Strings related to Settings -->
|
||||||
|
|
||||||
|
<!-- Example General settings -->
|
||||||
|
<string name="pref_header_general">Obecné</string>
|
||||||
|
|
||||||
|
<string name="pref_title_default_app_name">Aplikace pro dohlížení</string>
|
||||||
|
<string-array name="pref_default_app_name_list_titles">
|
||||||
|
<item>klávesnice Blackberry</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_default_app_name_list_values">
|
||||||
|
<item>com.blackberry.keyboard</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="pref_title_notification_importance">Důležitost oznámení</string>
|
||||||
|
<string-array name="pref_notification_importance_list_titles">
|
||||||
|
<item>Výchozí</item>
|
||||||
|
<item>Vysoká</item>
|
||||||
|
<item>Nízká</item>
|
||||||
|
<item>Min</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_notification_importance_list_values">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
<item>-1</item>
|
||||||
|
<item>-2</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="pref_title_notification_mode">Notification shape</string>
|
||||||
|
<string-array name="pref_notification_mode_list_titles">
|
||||||
|
<item>Samotný text</item>
|
||||||
|
<item>Text v kruhu</item>
|
||||||
|
<item>Text ve čtverci</item>
|
||||||
|
<item>Text v obrysu čtverce</item>
|
||||||
|
<item>Ikona</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_notification_mode_list_values">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
<item>3</item>
|
||||||
|
<item>4</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="pref_title_icon_builder">Vytváření ikony</string>
|
||||||
|
|
||||||
|
<!-- Example settings for Notifications -->
|
||||||
|
<string name="pref_header_notifications">Oznamování</string>
|
||||||
|
|
||||||
|
<string name="pref_title_text_fake_bold">Tučně</string>
|
||||||
|
<string name="pref_title_text_size">Velikost textu</string>
|
||||||
|
|
||||||
|
<string name="title_about">O aplikaci</string>
|
||||||
|
</resources>
|
||||||
@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">LayTray</string>
|
|
||||||
<string name="service_description">Простая иконка раскладки</string>
|
<string name="service_description">Простая иконка раскладки</string>
|
||||||
<string name="accessibility_summary">LayTray требуется доступ к специальным возможностям для того чтобы прослушивать уведомления от клавиатуры. LayTray не видит что вы печатаете и не отправляет никаких данных о вашей активности в интернет.</string>
|
<string name="accessibility_summary">LayTray требуется доступ к специальным возможностям для того чтобы прослушивать уведомления от клавиатуры. LayTray не видит что вы печатаете и не отправляет никаких данных о вашей активности в интернет.</string>
|
||||||
<string name="activity_info">Введите краткие названия для раскладок</string>
|
<string name="activity_info">Введите краткие названия для раскладок</string>
|
||||||
<string name="title_activity_settings">Настройки</string>
|
<string name="title_activity_settings">Настройки</string>
|
||||||
<string name="toast_enableme">Необходимо включить сервис!</string>
|
<string name="toast_enableme">Необходимо включить сервис!</string>
|
||||||
|
<string name="toast_saved">Сохранено</string>
|
||||||
|
|
||||||
<string name="pref_header_general">Общие</string>
|
<string name="pref_header_general">Общие</string>
|
||||||
|
|
||||||
@ -37,12 +37,14 @@
|
|||||||
<item>Текст в круге</item>
|
<item>Текст в круге</item>
|
||||||
<item>Текст в квадрате</item>
|
<item>Текст в квадрате</item>
|
||||||
<item>Текст в квадрате с обводкой</item>
|
<item>Текст в квадрате с обводкой</item>
|
||||||
|
<item>Иконка</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="pref_notification_mode_list_values">
|
<string-array name="pref_notification_mode_list_values">
|
||||||
<item>0</item>
|
<item>0</item>
|
||||||
<item>1</item>
|
<item>1</item>
|
||||||
<item>2</item>
|
<item>2</item>
|
||||||
<item>3</item>
|
<item>3</item>
|
||||||
|
<item>4</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string name="pref_title_icon_builder">Редактор иконок</string>
|
<string name="pref_title_icon_builder">Редактор иконок</string>
|
||||||
@ -54,6 +56,8 @@
|
|||||||
<string name="pref_title_text_size">Размер текста</string>
|
<string name="pref_title_text_size">Размер текста</string>
|
||||||
|
|
||||||
<string name="title_about">О программе</string>
|
<string name="title_about">О программе</string>
|
||||||
<string name="about_text">A layout icon by NeoTheFox \n
|
<string name="close">Закрыть</string>
|
||||||
Distributed on the terms of GNU GPLv3 licence</string>
|
<string name="unsupported_device">Телефон не поддерживается</string>
|
||||||
|
<string name="title_icon_channel">Иконка раскладки</string>
|
||||||
|
<string name="unsupported_device_description">На этом телефоне отсутствует клавиатура BlackBerry. LayTray не будет работать без него.</string>
|
||||||
</resources>
|
</resources>
|
||||||
@ -1,11 +1,15 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">LayTray</string>
|
<string name="app_name" translatable="false">LayTray</string>
|
||||||
<string name="service_description">A simple layout icon</string>
|
<string name="service_description">A simple layout icon</string>
|
||||||
<string name="accessibility_summary">LayTray needs to be enabled as an accessibility app, because the only way to get layout info on Android is by monitoring the Toast notification. Right now it monitors Blackberry Keyboard exclusively.</string>
|
<string name="accessibility_summary">LayTray needs to be enabled as an accessibility app, because the only way to get layout info on Android is by monitoring the Toast notification. LayTray can not see what you are typing and doesn\'t send any data about you or your activity to the third parties</string>
|
||||||
<string name="activity_info">Associate layout name with layout icon</string>
|
<string name="activity_info">Associate layout name with layout icon</string>
|
||||||
<string name="title_activity_settings">Settings</string>
|
<string name="title_activity_settings">Settings</string>
|
||||||
<string name="toast_enableme">You have to enable the service!</string>
|
<string name="toast_enableme">You have to enable the service!</string>
|
||||||
|
<string name="unsupported_device">Unsupported phone</string>
|
||||||
|
<string name="unsupported_device_description">This phone is missing the BlackBerry Keyboard. LayTray will not work without it.</string>
|
||||||
|
<string name="close">Close</string>
|
||||||
|
<string name="toast_saved">Saved</string>
|
||||||
|
<string name="title_icon_channel">Layout icon</string>
|
||||||
<!-- Strings related to Settings -->
|
<!-- Strings related to Settings -->
|
||||||
|
|
||||||
<!-- Example General settings -->
|
<!-- Example General settings -->
|
||||||
@ -39,12 +43,14 @@
|
|||||||
<item>Text in circle</item>
|
<item>Text in circle</item>
|
||||||
<item>Text in a square</item>
|
<item>Text in a square</item>
|
||||||
<item>Text in a square outline</item>
|
<item>Text in a square outline</item>
|
||||||
|
<item>Icon</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="pref_notification_mode_list_values">
|
<string-array name="pref_notification_mode_list_values">
|
||||||
<item>0</item>
|
<item>0</item>
|
||||||
<item>1</item>
|
<item>1</item>
|
||||||
<item>2</item>
|
<item>2</item>
|
||||||
<item>3</item>
|
<item>3</item>
|
||||||
|
<item>4</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string name="pref_title_icon_builder">Icon builder</string>
|
<string name="pref_title_icon_builder">Icon builder</string>
|
||||||
@ -56,6 +62,10 @@
|
|||||||
<string name="pref_title_text_size">Text size</string>
|
<string name="pref_title_text_size">Text size</string>
|
||||||
|
|
||||||
<string name="title_about">About</string>
|
<string name="title_about">About</string>
|
||||||
<string name="about_text">A layout icon by NeoTheFox \n
|
<string name="about_text" translatable="false">A layout icon by NeoTheFox \n
|
||||||
Distributed on the terms of GNU GPLv3 licence</string>
|
Distributed on the terms of GNU GPLv3 licence \n
|
||||||
|
\n
|
||||||
|
Translated by:\n
|
||||||
|
Belarusian - Edward Asviacinski\n
|
||||||
|
Czech - Pavel Borecki</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
4
app/src/main/res/xml/accessibility_service_config.xml
Normal file
4
app/src/main/res/xml/accessibility_service_config.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:description="@string/accessibility_summary"
|
||||||
|
android:settingsActivity="space.neothefox.laytray.MainActivity"
|
||||||
|
/>
|
||||||
@ -7,7 +7,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.1.3'
|
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||||
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user