mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Merge branch 'dev' into feature/sync
This commit is contained in:
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,5 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
### 1.5.3 (May 22, 2016)
|
||||||
|
|
||||||
|
* Complete Arabic and Czech translations
|
||||||
|
* Fix crash at startup
|
||||||
|
* Fix checkmark widget on custom launchers
|
||||||
|
|
||||||
|
### 1.5.2 (May 19, 2016)
|
||||||
|
|
||||||
|
* Fix missing attachment on bug reports
|
||||||
|
* Fix bug that prevents some widgets from rendering
|
||||||
|
* Complete Japanese translation
|
||||||
|
|
||||||
### 1.5.1 (May 17, 2016)
|
### 1.5.1 (May 17, 2016)
|
||||||
|
|
||||||
* Fix build on F-Droid
|
* Fix build on F-Droid
|
||||||
@@ -86,4 +98,4 @@
|
|||||||
|
|
||||||
### 1.0.0 (February 19, 2016)
|
### 1.0.0 (February 19, 2016)
|
||||||
|
|
||||||
* Initial release
|
* Initial release
|
||||||
|
|||||||
@@ -341,6 +341,6 @@ public class MainTest
|
|||||||
{
|
{
|
||||||
clickMenuItem(R.string.settings);
|
clickMenuItem(R.string.settings);
|
||||||
clickSettingsItem("Generate bug report");
|
clickSettingsItem("Generate bug report");
|
||||||
intended(hasAction(Intent.ACTION_SENDTO));
|
intended(hasAction(Intent.ACTION_SEND));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
<manifest
|
<manifest
|
||||||
package="org.isoron.uhabits"
|
package="org.isoron.uhabits"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:versionCode="17"
|
android:versionCode="19"
|
||||||
android:versionName="1.5.1">
|
android:versionName="1.5.3">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ abstract public class BaseActivity extends AppCompatActivity implements Thread.U
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
HabitsApplication.generateLogFile();
|
HabitsApplication.dumpBugReportToFile();
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import java.io.File;
|
|||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
|
||||||
public class HabitsApplication extends Application
|
public class HabitsApplication extends Application
|
||||||
{
|
{
|
||||||
@@ -87,6 +88,7 @@ public class HabitsApplication extends Application
|
|||||||
|
|
||||||
public static String getLogcat() throws IOException
|
public static String getLogcat() throws IOException
|
||||||
{
|
{
|
||||||
|
int maxNLines = 250;
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
String[] command = new String[] { "logcat", "-d"};
|
String[] command = new String[] { "logcat", "-d"};
|
||||||
@@ -95,10 +97,18 @@ public class HabitsApplication extends Application
|
|||||||
InputStreamReader in = new InputStreamReader(process.getInputStream());
|
InputStreamReader in = new InputStreamReader(process.getInputStream());
|
||||||
BufferedReader bufferedReader = new BufferedReader(in);
|
BufferedReader bufferedReader = new BufferedReader(in);
|
||||||
|
|
||||||
|
LinkedList<String> log = new LinkedList<>();
|
||||||
|
|
||||||
String line;
|
String line;
|
||||||
while ((line = bufferedReader.readLine()) != null)
|
while ((line = bufferedReader.readLine()) != null)
|
||||||
{
|
{
|
||||||
builder.append(line);
|
log.addLast(line);
|
||||||
|
if(log.size() > maxNLines) log.removeFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
for(String l : log)
|
||||||
|
{
|
||||||
|
builder.append(l);
|
||||||
builder.append('\n');
|
builder.append('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,10 +140,8 @@ public class HabitsApplication extends Application
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public static File generateLogFile() throws IOException
|
public static File dumpBugReportToFile() throws IOException
|
||||||
{
|
{
|
||||||
String logcat = getLogcat();
|
|
||||||
String deviceInfo = getDeviceInfo();
|
|
||||||
String date = DateHelper.getBackupDateFormat().format(DateHelper.getLocalTime());
|
String date = DateHelper.getBackupDateFormat().format(DateHelper.getLocalTime());
|
||||||
|
|
||||||
if(context == null) throw new RuntimeException("application context should not be null");
|
if(context == null) throw new RuntimeException("application context should not be null");
|
||||||
@@ -142,10 +150,17 @@ public class HabitsApplication extends Application
|
|||||||
|
|
||||||
File logFile = new File(String.format("%s/Log %s.txt", dir.getPath(), date));
|
File logFile = new File(String.format("%s/Log %s.txt", dir.getPath(), date));
|
||||||
FileWriter output = new FileWriter(logFile);
|
FileWriter output = new FileWriter(logFile);
|
||||||
output.write(deviceInfo);
|
output.write(generateBugReport());
|
||||||
output.write(logcat);
|
|
||||||
output.close();
|
output.close();
|
||||||
|
|
||||||
return logFile;
|
return logFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public static String generateBugReport() throws IOException
|
||||||
|
{
|
||||||
|
String logcat = getLogcat();
|
||||||
|
String deviceInfo = getDeviceInfo();
|
||||||
|
return deviceInfo + "\n" + logcat;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ import org.isoron.uhabits.helpers.ReminderHelper;
|
|||||||
import org.isoron.uhabits.helpers.UIHelper;
|
import org.isoron.uhabits.helpers.UIHelper;
|
||||||
import org.isoron.uhabits.models.Habit;
|
import org.isoron.uhabits.models.Habit;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class MainActivity extends BaseActivity
|
public class MainActivity extends BaseActivity
|
||||||
@@ -230,12 +229,25 @@ public class MainActivity extends BaseActivity
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File logFile = HabitsApplication.generateLogFile();
|
HabitsApplication.dumpBugReportToFile();
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String log = "---------- BUG REPORT BEGINS ----------\n";
|
||||||
|
log += HabitsApplication.generateBugReport();
|
||||||
|
log += "---------- BUG REPORT ENDS ------------\n";
|
||||||
|
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(Intent.ACTION_SENDTO);
|
intent.setAction(Intent.ACTION_SEND);
|
||||||
intent.setData(Uri.parse(getString(R.string.bugReportURL)));
|
intent.setType("message/rfc822");
|
||||||
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(logFile));
|
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { "dev@loophabits.org" });
|
||||||
|
intent.putExtra(Intent.EXTRA_SUBJECT, "Bug Report - Loop Habit Tracker");
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, log);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
|
|||||||
@@ -93,8 +93,9 @@ public class ReminderHelper
|
|||||||
else
|
else
|
||||||
manager.set(AlarmManager.RTC_WAKEUP, reminderTime, pendingIntent);
|
manager.set(AlarmManager.RTC_WAKEUP, reminderTime, pendingIntent);
|
||||||
|
|
||||||
|
String name = habit.name.substring(0, Math.min(3, habit.name.length()));
|
||||||
Log.d("ReminderHelper", String.format("Setting alarm (%s): %s",
|
Log.d("ReminderHelper", String.format("Setting alarm (%s): %s",
|
||||||
DateFormat.getDateTimeInstance().format(new Date(reminderTime)), habit.name));
|
DateFormat.getDateTimeInstance().format(new Date(reminderTime)), name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ public abstract class UIHelper
|
|||||||
{
|
{
|
||||||
// TODO: Move this to another place, or detect automatically
|
// TODO: Move this to another place, or detect automatically
|
||||||
String fullyTranslatedLanguages[] = { "ca", "zh", "en", "de", "in", "it", "ko", "pl", "pt",
|
String fullyTranslatedLanguages[] = { "ca", "zh", "en", "de", "in", "it", "ko", "pl", "pt",
|
||||||
"es", "tk", "uk"};
|
"es", "tk", "uk", "ja"};
|
||||||
|
|
||||||
final String currentLanguage = Locale.getDefault().getLanguage();
|
final String currentLanguage = Locale.getDefault().getLanguage();
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import android.content.Context;
|
|||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
import android.util.TypedValue;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.isoron.uhabits.R;
|
import org.isoron.uhabits.R;
|
||||||
@@ -40,7 +41,6 @@ public class CheckmarkWidgetView extends HabitWidgetView implements HabitDataVie
|
|||||||
@Nullable
|
@Nullable
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private RingView ring;
|
private RingView ring;
|
||||||
private TextView label;
|
private TextView label;
|
||||||
private int checkmarkValue;
|
private int checkmarkValue;
|
||||||
@@ -147,8 +147,22 @@ public class CheckmarkWidgetView extends HabitWidgetView implements HabitDataVie
|
|||||||
w *= scale;
|
w *= scale;
|
||||||
h *= scale;
|
h *= scale;
|
||||||
|
|
||||||
|
if(h < getResources().getDimension(R.dimen.checkmarkWidget_heightBreakpoint))
|
||||||
|
ring.setVisibility(GONE);
|
||||||
|
else
|
||||||
|
ring.setVisibility(VISIBLE);
|
||||||
|
|
||||||
widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) w, MeasureSpec.EXACTLY);
|
widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) w, MeasureSpec.EXACTLY);
|
||||||
heightMeasureSpec = MeasureSpec.makeMeasureSpec((int) h, MeasureSpec.EXACTLY);
|
heightMeasureSpec = MeasureSpec.makeMeasureSpec((int) h, MeasureSpec.EXACTLY);
|
||||||
|
|
||||||
|
float textSize = 0.15f * h;
|
||||||
|
float maxTextSize = getResources().getDimension(R.dimen.smallerTextSize);
|
||||||
|
textSize = Math.min(textSize, maxTextSize);
|
||||||
|
|
||||||
|
label.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||||
|
ring.setTextSize(textSize);
|
||||||
|
ring.setThickness(0.15f * textSize);
|
||||||
|
|
||||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import android.graphics.Paint;
|
|||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.PorterDuffXfermode;
|
import android.graphics.PorterDuffXfermode;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
import android.text.TextPaint;
|
import android.text.TextPaint;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -57,8 +58,10 @@ public class RingView extends View
|
|||||||
private float textSize;
|
private float textSize;
|
||||||
private boolean enableFontAwesome;
|
private boolean enableFontAwesome;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private Bitmap drawingCache;
|
private Bitmap drawingCache;
|
||||||
private Canvas cacheCanvas;
|
private Canvas cacheCanvas;
|
||||||
|
|
||||||
private boolean isTransparencyEnabled;
|
private boolean isTransparencyEnabled;
|
||||||
|
|
||||||
public RingView(Context context)
|
public RingView(Context context)
|
||||||
@@ -106,6 +109,11 @@ public class RingView extends View
|
|||||||
postInvalidate();
|
postInvalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTextSize(float textSize)
|
||||||
|
{
|
||||||
|
this.textSize = textSize;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBackgroundColor(int backgroundColor)
|
public void setBackgroundColor(int backgroundColor)
|
||||||
{
|
{
|
||||||
@@ -175,12 +183,14 @@ public class RingView extends View
|
|||||||
{
|
{
|
||||||
super.onSizeChanged(w, h, oldw, oldh);
|
super.onSizeChanged(w, h, oldw, oldh);
|
||||||
|
|
||||||
if(isTransparencyEnabled)
|
if(isTransparencyEnabled) reallocateCache();
|
||||||
{
|
}
|
||||||
if (drawingCache != null) drawingCache.recycle();
|
|
||||||
drawingCache = Bitmap.createBitmap(diameter, diameter, Bitmap.Config.ARGB_8888);
|
private void reallocateCache()
|
||||||
cacheCanvas = new Canvas(drawingCache);
|
{
|
||||||
}
|
if (drawingCache != null) drawingCache.recycle();
|
||||||
|
drawingCache = Bitmap.createBitmap(diameter, diameter, Bitmap.Config.ARGB_8888);
|
||||||
|
cacheCanvas = new Canvas(drawingCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -191,6 +201,7 @@ public class RingView extends View
|
|||||||
|
|
||||||
if(isTransparencyEnabled)
|
if(isTransparencyEnabled)
|
||||||
{
|
{
|
||||||
|
if(drawingCache == null) reallocateCache();
|
||||||
activeCanvas = cacheCanvas;
|
activeCanvas = cacheCanvas;
|
||||||
drawingCache.eraseColor(Color.TRANSPARENT);
|
drawingCache.eraseColor(Color.TRANSPARENT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,9 +45,11 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public abstract class BaseWidgetProvider extends AppWidgetProvider
|
public abstract class BaseWidgetProvider extends AppWidgetProvider
|
||||||
{
|
{
|
||||||
|
private class WidgetDimensions
|
||||||
private int portraitWidth, portraitHeight;
|
{
|
||||||
private int landscapeWidth, landscapeHeight;
|
public int portraitWidth, portraitHeight;
|
||||||
|
public int landscapeWidth, landscapeHeight;
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract int getDefaultHeight();
|
protected abstract int getDefaultHeight();
|
||||||
|
|
||||||
@@ -71,7 +73,7 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(appContext);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(appContext);
|
||||||
|
|
||||||
for(Integer id : appWidgetIds)
|
for(Integer id : appWidgetIds)
|
||||||
prefs.edit().remove(getHabitIdKey(id));
|
prefs.edit().remove(getHabitIdKey(id)).apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -98,7 +100,7 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
private void updateWidget(Context context, AppWidgetManager manager,
|
private void updateWidget(Context context, AppWidgetManager manager,
|
||||||
int widgetId, Bundle options)
|
int widgetId, Bundle options)
|
||||||
{
|
{
|
||||||
updateWidgetSize(context, options);
|
WidgetDimensions dim = getWidgetDimensions(context, options);
|
||||||
|
|
||||||
Context appContext = context.getApplicationContext();
|
Context appContext = context.getApplicationContext();
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(appContext);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(appContext);
|
||||||
@@ -113,7 +115,7 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
new RenderWidgetTask(widgetId, context, habit, manager).execute();
|
new RenderWidgetTask(widgetId, context, habit, dim, manager).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawErrorWidget(Context context, AppWidgetManager manager, int widgetId)
|
private void drawErrorWidget(Context context, AppWidgetManager manager, int widgetId)
|
||||||
@@ -159,7 +161,7 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateWidgetSize(Context context, Bundle options)
|
private WidgetDimensions getWidgetDimensions(Context context, Bundle options)
|
||||||
{
|
{
|
||||||
int maxWidth = getDefaultWidth();
|
int maxWidth = getDefaultWidth();
|
||||||
int minWidth = getDefaultWidth();
|
int minWidth = getDefaultWidth();
|
||||||
@@ -178,11 +180,12 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT));
|
options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT));
|
||||||
}
|
}
|
||||||
|
|
||||||
portraitWidth = minWidth;
|
WidgetDimensions ws = new WidgetDimensions();
|
||||||
portraitHeight = maxHeight;
|
ws.portraitWidth = minWidth;
|
||||||
|
ws.portraitHeight = maxHeight;
|
||||||
landscapeWidth = maxWidth;
|
ws.landscapeWidth = maxWidth;
|
||||||
landscapeHeight = minHeight;
|
ws.landscapeHeight = minHeight;
|
||||||
|
return ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void measureCustomView(Context context, int w, int h, View customView)
|
private void measureCustomView(Context context, int w, int h, View customView)
|
||||||
@@ -212,16 +215,18 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
private final Context context;
|
private final Context context;
|
||||||
private final Habit habit;
|
private final Habit habit;
|
||||||
private final AppWidgetManager manager;
|
private final AppWidgetManager manager;
|
||||||
public RemoteViews portraitRemoteViews, landscapeRemoteViews;
|
private RemoteViews portraitRemoteViews, landscapeRemoteViews;
|
||||||
public View portraitWidgetView, landscapeWidgetView;
|
private View portraitWidgetView, landscapeWidgetView;
|
||||||
|
private WidgetDimensions dim;
|
||||||
|
|
||||||
public RenderWidgetTask(int widgetId, Context context, Habit habit,
|
public RenderWidgetTask(int widgetId, Context context, Habit habit, WidgetDimensions ws,
|
||||||
AppWidgetManager manager)
|
AppWidgetManager manager)
|
||||||
{
|
{
|
||||||
this.widgetId = widgetId;
|
this.widgetId = widgetId;
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.habit = habit;
|
this.habit = habit;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
|
this.dim = ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -232,11 +237,12 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
|
|
||||||
portraitRemoteViews = new RemoteViews(context.getPackageName(), getLayoutId());
|
portraitRemoteViews = new RemoteViews(context.getPackageName(), getLayoutId());
|
||||||
portraitWidgetView = buildCustomView(context, habit);
|
portraitWidgetView = buildCustomView(context, habit);
|
||||||
measureCustomView(context, portraitWidth, portraitHeight, portraitWidgetView);
|
measureCustomView(context, dim.portraitWidth, dim.portraitHeight, portraitWidgetView);
|
||||||
|
|
||||||
landscapeRemoteViews = new RemoteViews(context.getPackageName(), getLayoutId());
|
landscapeRemoteViews = new RemoteViews(context.getPackageName(), getLayoutId());
|
||||||
landscapeWidgetView = buildCustomView(context, habit);
|
landscapeWidgetView = buildCustomView(context, habit);
|
||||||
measureCustomView(context, landscapeWidth, landscapeHeight, landscapeWidgetView);
|
measureCustomView(context, dim.landscapeWidth, dim.landscapeHeight,
|
||||||
|
landscapeWidgetView);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAppWidget()
|
private void updateAppWidget()
|
||||||
@@ -260,8 +266,10 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
buildRemoteViews(portraitWidgetView, portraitRemoteViews, portraitWidth, portraitHeight);
|
buildRemoteViews(portraitWidgetView, portraitRemoteViews,
|
||||||
buildRemoteViews(landscapeWidgetView, landscapeRemoteViews, landscapeWidth, landscapeHeight);
|
dim.portraitWidth, dim.portraitHeight);
|
||||||
|
buildRemoteViews(landscapeWidgetView, landscapeRemoteViews,
|
||||||
|
dim.landscapeWidth, dim.landscapeHeight);
|
||||||
updateAppWidget();
|
updateAppWidget();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -273,7 +281,8 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
super.onPostExecute(aVoid);
|
super.onPostExecute(aVoid);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildRemoteViews(View widgetView, RemoteViews remoteViews, int width, int height)
|
private void buildRemoteViews(View widgetView, RemoteViews remoteViews, int width,
|
||||||
|
int height)
|
||||||
{
|
{
|
||||||
widgetView.invalidate();
|
widgetView.invalidate();
|
||||||
widgetView.setDrawingCacheEnabled(true);
|
widgetView.setDrawingCacheEnabled(true);
|
||||||
@@ -287,7 +296,6 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
|
|||||||
int imageWidth = widgetView.getMeasuredWidth();
|
int imageWidth = widgetView.getMeasuredWidth();
|
||||||
int imageHeight = widgetView.getMeasuredHeight();
|
int imageHeight = widgetView.getMeasuredHeight();
|
||||||
int p[] = getPadding(width, height, imageWidth, imageHeight);
|
int p[] = getPadding(width, height, imageWidth, imageHeight);
|
||||||
|
|
||||||
remoteViews.setViewPadding(R.id.buttonOverlay, p[0], p[1], p[2], p[3]);
|
remoteViews.setViewPadding(R.id.buttonOverlay, p[0], p[1], p[2], p[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,4 +159,32 @@
|
|||||||
<string name="bug_report_failed">"فشل في توليد تقرير الاعطال"</string>
|
<string name="bug_report_failed">"فشل في توليد تقرير الاعطال"</string>
|
||||||
<string name="generate_bug_report">"توليد تقرير الاعطال"</string>
|
<string name="generate_bug_report">"توليد تقرير الاعطال"</string>
|
||||||
<string name="troubleshooting">"استكشاف الأخطاء وإصلاحها"</string>
|
<string name="troubleshooting">"استكشاف الأخطاء وإصلاحها"</string>
|
||||||
|
<string name="help_translate">"المساعدة في ترجمة هذا البرنامج"</string>
|
||||||
|
<string name="night_mode">"الوضع الليلي"</string>
|
||||||
|
<string name="use_pure_black">"استخدام أسود نقي في الوضع الليلي"</string>
|
||||||
|
<string name="pure_black_description">"يستبدل خلفيات رمادية مع أسود نقي في الوضع الليلي. يقلل من استهلاك البطارية في الهواتف مع شاشة AMOLED."</string>
|
||||||
|
<string name="interface_preferences">"السطح البيني"</string>
|
||||||
|
<string name="reverse_days">"ترتيب عكسي أيام"</string>
|
||||||
|
<string name="reverse_days_description">"عرض أيام في ترتيب عكسي على الشاشة الرئيسية"</string>
|
||||||
|
<string name="day">"يوم"</string>
|
||||||
|
<string name="week">"أسبوع"</string>
|
||||||
|
<string name="month">"شهر"</string>
|
||||||
|
|
||||||
|
<!-- Three-month period -->
|
||||||
|
<string name="quarter">"ربع سنه"</string>
|
||||||
|
<string name="year">"عام"</string>
|
||||||
|
|
||||||
|
<!-- Middle part of the sentence '1 time in xx days' -->
|
||||||
|
<!-- Middle part of the sentence '1 time in xx days' -->
|
||||||
|
<string name="time_every">"مرات في"</string>
|
||||||
|
<string name="every_x_days">"كل %d أيام"</string>
|
||||||
|
<string name="every_x_weeks">"كل %d أسابيع"</string>
|
||||||
|
<string name="every_x_months">"كل %d أشهر"</string>
|
||||||
|
|
||||||
|
<!-- The old "habit strength" has been replaced by "score". Feel free to translate "score" as "strength" or "stability" if it sounds more natural in your language. -->
|
||||||
|
<string name="score">"النقاط"</string>
|
||||||
|
<string name="reminder_sound">"صوت تذكير"</string>
|
||||||
|
|
||||||
|
<!-- Appears when the user disables the reminder sound. Could also be "no sound", "mute" or "silent". -->
|
||||||
|
<string name="none">"صامت"</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">"Loop Habit Tracker</string>
|
|
||||||
|
<!-- Fuzzy -->
|
||||||
|
<string name="app_name">"Loop Habit Tracker"</string>
|
||||||
<string name="main_activity_title">"Zvyky"</string>
|
<string name="main_activity_title">"Zvyky"</string>
|
||||||
<string name="action_settings">"Nastavení"</string>
|
<string name="action_settings">"Nastavení"</string>
|
||||||
<string name="edit">"Upravit"</string>
|
<string name="edit">"Upravit"</string>
|
||||||
@@ -150,4 +152,32 @@ Upomínky mohou být potvrzen, odloženy nebo smazány přímo z tvého zaříze
|
|||||||
<string name="bug_report_failed">"Generace výpisu chyb selhala."</string>
|
<string name="bug_report_failed">"Generace výpisu chyb selhala."</string>
|
||||||
<string name="generate_bug_report">"Generovat výpis chyb"</string>
|
<string name="generate_bug_report">"Generovat výpis chyb"</string>
|
||||||
<string name="troubleshooting">"Řešení problémů"</string>
|
<string name="troubleshooting">"Řešení problémů"</string>
|
||||||
|
<string name="help_translate">"Pomozte s překladem aplikace"</string>
|
||||||
|
<string name="night_mode">"Noční téma"</string>
|
||||||
|
<string name="use_pure_black">"Zobrazit čistě černou v nočním tématu"</string>
|
||||||
|
<string name="pure_black_description">"Nahradí šedé pozadí čistou černou v nočním tématu. Snižuje spotřebu baterie v telefonech s AMOLED displejem."</string>
|
||||||
|
<string name="interface_preferences">"Rozhraní"</string>
|
||||||
|
<string name="reverse_days">"Otočit pořadí dnů"</string>
|
||||||
|
<string name="reverse_days_description">"Zobrazí dny na úvodní stránce v obráceném pořadí"</string>
|
||||||
|
<string name="day">"Den"</string>
|
||||||
|
<string name="week">"Týden"</string>
|
||||||
|
<string name="month">"Měsíc"</string>
|
||||||
|
|
||||||
|
<!-- Three-month period -->
|
||||||
|
<string name="quarter">"Čtvrtletí"</string>
|
||||||
|
<string name="year">"Rok"</string>
|
||||||
|
|
||||||
|
<!-- Middle part of the sentence '1 time in xx days' -->
|
||||||
|
<!-- Middle part of the sentence '1 time in xx days' -->
|
||||||
|
<string name="time_every">"krát za"</string>
|
||||||
|
<string name="every_x_days">"Každých %d dní"</string>
|
||||||
|
<string name="every_x_weeks">"Každých %d týdnů"</string>
|
||||||
|
<string name="every_x_months">"Každých %d měsíců"</string>
|
||||||
|
|
||||||
|
<!-- The old "habit strength" has been replaced by "score". Feel free to translate "score" as "strength" or "stability" if it sounds more natural in your language. -->
|
||||||
|
<string name="score">"Skóre"</string>
|
||||||
|
<string name="reminder_sound">"Zvuk upomínky"</string>
|
||||||
|
|
||||||
|
<!-- Appears when the user disables the reminder sound. Could also be "no sound", "mute" or "silent". -->
|
||||||
|
<string name="none">"Žádný"</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -149,4 +149,32 @@ Android Wear 端末から直接、リマインダーをチェック、スヌー
|
|||||||
<string name="bug_report_failed">"バグ報告の生成に失敗しました。"</string>
|
<string name="bug_report_failed">"バグ報告の生成に失敗しました。"</string>
|
||||||
<string name="generate_bug_report">"バグ報告の生成"</string>
|
<string name="generate_bug_report">"バグ報告の生成"</string>
|
||||||
<string name="troubleshooting">"トラブルシューティング"</string>
|
<string name="troubleshooting">"トラブルシューティング"</string>
|
||||||
|
<string name="help_translate">"このアプリの翻訳を支援する"</string>
|
||||||
|
<string name="night_mode">"夜間モード"</string>
|
||||||
|
<string name="use_pure_black">"夜間モードで真黒を使用する"</string>
|
||||||
|
<string name="pure_black_description">"夜間モードで灰色の背景を黒で置き換えます。AMOLED ディスプレイの電話でバッテリー使用量を抑えます。"</string>
|
||||||
|
<string name="interface_preferences">"インターフェース"</string>
|
||||||
|
<string name="reverse_days">"日の順序を逆転する"</string>
|
||||||
|
<string name="reverse_days_description">"メイン画面で日を逆順に表示します"</string>
|
||||||
|
<string name="day">"日"</string>
|
||||||
|
<string name="week">"週"</string>
|
||||||
|
<string name="month">"月"</string>
|
||||||
|
|
||||||
|
<!-- Three-month period -->
|
||||||
|
<string name="quarter">"四半期"</string>
|
||||||
|
<string name="year">"年"</string>
|
||||||
|
|
||||||
|
<!-- Middle part of the sentence '1 time in xx days' -->
|
||||||
|
<!-- Middle part of the sentence '1 time in xx days' -->
|
||||||
|
<string name="time_every">"回 /"</string>
|
||||||
|
<string name="every_x_days">"%d 日ごと"</string>
|
||||||
|
<string name="every_x_weeks">"%d 週ごと"</string>
|
||||||
|
<string name="every_x_months">"%d ヶ月ごと"</string>
|
||||||
|
|
||||||
|
<!-- The old "habit strength" has been replaced by "score". Feel free to translate "score" as "strength" or "stability" if it sounds more natural in your language. -->
|
||||||
|
<string name="score">"スコア"</string>
|
||||||
|
<string name="reminder_sound">"リマインダー サウンド"</string>
|
||||||
|
|
||||||
|
<!-- Appears when the user disables the reminder sound. Could also be "no sound", "mute" or "silent". -->
|
||||||
|
<string name="none">"なし"</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -26,7 +26,9 @@
|
|||||||
<dimen name="history_max_font_size">@dimen/regularTextSize</dimen>
|
<dimen name="history_max_font_size">@dimen/regularTextSize</dimen>
|
||||||
<dimen name="regularTextSize">16sp</dimen>
|
<dimen name="regularTextSize">16sp</dimen>
|
||||||
<dimen name="smallTextSize">14sp</dimen>
|
<dimen name="smallTextSize">14sp</dimen>
|
||||||
|
<dimen name="smallerTextSize">12sp</dimen>
|
||||||
<dimen name="tinyTextSize">10sp</dimen>
|
<dimen name="tinyTextSize">10sp</dimen>
|
||||||
<dimen name="habitNameWidth">160dp</dimen>
|
<dimen name="habitNameWidth">160dp</dimen>
|
||||||
<dimen name="progressbarOffset">-10dp</dimen>
|
<dimen name="progressbarOffset">-10dp</dimen>
|
||||||
|
<dimen name="checkmarkWidget_heightBreakpoint">55dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user