Make the log display honour the theme
This commit is contained in:
parent
e267daf602
commit
0d1d6542ea
|
@ -43,6 +43,7 @@ import org.sufficientlysecure.keychain.operations.results.OperationResult;
|
||||||
import org.sufficientlysecure.keychain.operations.results.OperationResult.LogEntryParcel;
|
import org.sufficientlysecure.keychain.operations.results.OperationResult.LogEntryParcel;
|
||||||
import org.sufficientlysecure.keychain.operations.results.OperationResult.LogLevel;
|
import org.sufficientlysecure.keychain.operations.results.OperationResult.LogLevel;
|
||||||
import org.sufficientlysecure.keychain.operations.results.OperationResult.SubLogEntryParcel;
|
import org.sufficientlysecure.keychain.operations.results.OperationResult.SubLogEntryParcel;
|
||||||
|
import org.sufficientlysecure.keychain.ui.util.FormattingUtils;
|
||||||
import org.sufficientlysecure.keychain.util.FileHelper;
|
import org.sufficientlysecure.keychain.util.FileHelper;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
|
@ -57,10 +58,12 @@ public class LogDisplayFragment extends ListFragment implements OnItemClickListe
|
||||||
OperationResult mResult;
|
OperationResult mResult;
|
||||||
|
|
||||||
public static final String EXTRA_RESULT = "log";
|
public static final String EXTRA_RESULT = "log";
|
||||||
|
protected int mTextColor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
mTextColor = FormattingUtils.getColorFromAttr(getActivity(), R.attr.colorText);
|
||||||
|
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
|
@ -357,13 +360,13 @@ public class LogDisplayFragment extends ListFragment implements OnItemClickListe
|
||||||
ih.mSecondText.setText(getResources().getString(subEntry.mType.getMsgId(),
|
ih.mSecondText.setText(getResources().getString(subEntry.mType.getMsgId(),
|
||||||
subEntry.mParameters));
|
subEntry.mParameters));
|
||||||
}
|
}
|
||||||
ih.mSecondText.setTextColor(subEntry.mType.mLevel == LogLevel.DEBUG ? Color.GRAY : Color.BLACK);
|
ih.mSecondText.setTextColor(subEntry.mType.mLevel == LogLevel.DEBUG ? Color.GRAY : mTextColor);
|
||||||
switch (subEntry.mType.mLevel) {
|
switch (subEntry.mType.mLevel) {
|
||||||
case DEBUG: ih.mSecondImg.setBackgroundColor(Color.GRAY); break;
|
case DEBUG: ih.mSecondImg.setBackgroundColor(Color.GRAY); break;
|
||||||
case INFO: ih.mSecondImg.setBackgroundColor(Color.BLACK); break;
|
case INFO: ih.mSecondImg.setBackgroundColor(mTextColor); break;
|
||||||
case WARN: ih.mSecondImg.setBackgroundColor(getResources().getColor(R.color.android_orange_light)); break;
|
case WARN: ih.mSecondImg.setBackgroundColor(getResources().getColor(R.color.android_orange_light)); break;
|
||||||
case ERROR: ih.mSecondImg.setBackgroundColor(getResources().getColor(R.color.android_red_light)); break;
|
case ERROR: ih.mSecondImg.setBackgroundColor(getResources().getColor(R.color.android_red_light)); break;
|
||||||
case START: ih.mSecondImg.setBackgroundColor(Color.BLACK); break;
|
case START: ih.mSecondImg.setBackgroundColor(mTextColor); break;
|
||||||
case OK: ih.mSecondImg.setBackgroundColor(getResources().getColor(R.color.android_green_light)); break;
|
case OK: ih.mSecondImg.setBackgroundColor(getResources().getColor(R.color.android_green_light)); break;
|
||||||
case CANCELLED: ih.mSecondImg.setBackgroundColor(getResources().getColor(R.color.android_red_light)); break;
|
case CANCELLED: ih.mSecondImg.setBackgroundColor(getResources().getColor(R.color.android_red_light)); break;
|
||||||
}
|
}
|
||||||
|
@ -388,13 +391,13 @@ public class LogDisplayFragment extends ListFragment implements OnItemClickListe
|
||||||
entry.mParameters));
|
entry.mParameters));
|
||||||
}
|
}
|
||||||
convertView.setPadding((entry.mIndent) * dipFactor, 0, 0, 0);
|
convertView.setPadding((entry.mIndent) * dipFactor, 0, 0, 0);
|
||||||
ih.mText.setTextColor(entry.mType.mLevel == LogLevel.DEBUG ? Color.GRAY : Color.BLACK);
|
ih.mText.setTextColor(entry.mType.mLevel == LogLevel.DEBUG ? Color.GRAY : mTextColor);
|
||||||
switch (entry.mType.mLevel) {
|
switch (entry.mType.mLevel) {
|
||||||
case DEBUG: ih.mImg.setBackgroundColor(Color.GRAY); break;
|
case DEBUG: ih.mImg.setBackgroundColor(Color.GRAY); break;
|
||||||
case INFO: ih.mImg.setBackgroundColor(Color.BLACK); break;
|
case INFO: ih.mImg.setBackgroundColor(mTextColor); break;
|
||||||
case WARN: ih.mImg.setBackgroundColor(getResources().getColor(R.color.android_orange_light)); break;
|
case WARN: ih.mImg.setBackgroundColor(getResources().getColor(R.color.android_orange_light)); break;
|
||||||
case ERROR: ih.mImg.setBackgroundColor(getResources().getColor(R.color.android_red_light)); break;
|
case ERROR: ih.mImg.setBackgroundColor(getResources().getColor(R.color.android_red_light)); break;
|
||||||
case START: ih.mImg.setBackgroundColor(Color.BLACK); break;
|
case START: ih.mImg.setBackgroundColor(mTextColor); break;
|
||||||
case OK: ih.mImg.setBackgroundColor(getResources().getColor(R.color.android_green_light)); break;
|
case OK: ih.mImg.setBackgroundColor(getResources().getColor(R.color.android_green_light)); break;
|
||||||
case CANCELLED: ih.mImg.setBackgroundColor(getResources().getColor(R.color.android_red_light)); break;
|
case CANCELLED: ih.mImg.setBackgroundColor(getResources().getColor(R.color.android_red_light)); break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue