Merge branch 'hotfix/1.5.2'

pull/114/merge v1.5.2
Alinson S. Xavier 9 years ago
commit bd6cba8303

@ -1,5 +1,11 @@
# Changelog
### 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)
* Fix build on F-Droid

@ -21,8 +21,8 @@
<manifest
package="org.isoron.uhabits"
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="17"
android:versionName="1.5.1">
android:versionCode="18"
android:versionName="1.5.2">
<uses-permission android:name="android.permission.VIBRATE"/>

@ -154,7 +154,7 @@ abstract public class BaseActivity extends AppCompatActivity implements Thread.U
try
{
ex.printStackTrace();
HabitsApplication.generateLogFile();
HabitsApplication.dumpBugReportToFile();
}
catch(Exception e)
{

@ -36,6 +36,7 @@ import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
public class HabitsApplication extends Application
{
@ -87,6 +88,7 @@ public class HabitsApplication extends Application
public static String getLogcat() throws IOException
{
int maxNLines = 250;
StringBuilder builder = new StringBuilder();
String[] command = new String[] { "logcat", "-d"};
@ -95,10 +97,18 @@ public class HabitsApplication extends Application
InputStreamReader in = new InputStreamReader(process.getInputStream());
BufferedReader bufferedReader = new BufferedReader(in);
LinkedList<String> log = new LinkedList<>();
String line;
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');
}
@ -130,10 +140,8 @@ public class HabitsApplication extends Application
}
@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());
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));
FileWriter output = new FileWriter(logFile);
output.write(deviceInfo);
output.write(logcat);
output.write(generateBugReport());
output.close();
return logFile;
}
@NonNull
public static String generateBugReport() throws IOException
{
String logcat = getLogcat();
String deviceInfo = getDeviceInfo();
return deviceInfo + "\n" + logcat;
}
}

@ -53,7 +53,6 @@ import org.isoron.uhabits.widgets.HistoryWidgetProvider;
import org.isoron.uhabits.widgets.ScoreWidgetProvider;
import org.isoron.uhabits.widgets.StreakWidgetProvider;
import java.io.File;
import java.io.IOException;
public class MainActivity extends BaseActivity
@ -239,12 +238,25 @@ public class MainActivity extends BaseActivity
{
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.setAction(Intent.ACTION_SENDTO);
intent.setData(Uri.parse(getString(R.string.bugReportURL)));
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(logFile));
intent.setAction(Intent.ACTION_SEND);
intent.setType("message/rfc822");
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);
}
catch (IOException e)

@ -93,8 +93,9 @@ public class ReminderHelper
else
manager.set(AlarmManager.RTC_WAKEUP, reminderTime, pendingIntent);
Log.d("ReminderHelper", String.format("Setting alarm (%s): %s",
DateFormat.getDateTimeInstance().format(new Date(reminderTime)), habit.name));
Log.d("ReminderHelper", String.format("Setting alarm (%s): %s...",
DateFormat.getDateTimeInstance().format(new Date(reminderTime)),
habit.name.substring(0, 3)));
}
@Nullable

@ -191,7 +191,7 @@ public abstract class UIHelper
{
// TODO: Move this to another place, or detect automatically
String fullyTranslatedLanguages[] = { "ca", "zh", "en", "de", "in", "it", "ko", "pl", "pt",
"es", "tk", "uk"};
"es", "tk", "uk", "ja"};
final String currentLanguage = Locale.getDefault().getLanguage();

@ -27,6 +27,7 @@ import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.support.annotation.Nullable;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.View;
@ -57,8 +58,10 @@ public class RingView extends View
private float textSize;
private boolean enableFontAwesome;
@Nullable
private Bitmap drawingCache;
private Canvas cacheCanvas;
private boolean isTransparencyEnabled;
public RingView(Context context)
@ -175,12 +178,14 @@ public class RingView extends View
{
super.onSizeChanged(w, h, oldw, oldh);
if(isTransparencyEnabled)
{
if (drawingCache != null) drawingCache.recycle();
drawingCache = Bitmap.createBitmap(diameter, diameter, Bitmap.Config.ARGB_8888);
cacheCanvas = new Canvas(drawingCache);
}
if(isTransparencyEnabled) reallocateCache();
}
private void reallocateCache()
{
if (drawingCache != null) drawingCache.recycle();
drawingCache = Bitmap.createBitmap(diameter, diameter, Bitmap.Config.ARGB_8888);
cacheCanvas = new Canvas(drawingCache);
}
@Override
@ -191,6 +196,7 @@ public class RingView extends View
if(isTransparencyEnabled)
{
if(drawingCache == null) reallocateCache();
activeCanvas = cacheCanvas;
drawingCache.eraseColor(Color.TRANSPARENT);
}

@ -149,4 +149,32 @@ Android Wear 端末から直接、リマインダーをチェック、スヌー
<string name="bug_report_failed">"バグ報告の生成に失敗しました。"</string>
<string name="generate_bug_report">"バグ報告の生成"</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>
Loading…
Cancel
Save