This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weiyiWorkCell:DVR weiyi$ git diff | |
diff --git a/app/src/main/java/com/magellan/dvr/activity/WarningsActivity.java b/app/src/main/java/com/magellan/dvr/activity/WarningsActivity.java | |
index 63b8869..7813fb5 100644 | |
--- a/app/src/main/java/com/magellan/dvr/activity/WarningsActivity.java | |
+++ b/app/src/main/java/com/magellan/dvr/activity/WarningsActivity.java | |
@@ -47,6 +47,7 @@ public class WarningsActivity extends Activity { | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); | |
+ getWindow().setWindowAnimations(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Class | Package | Subclass | World | |
————————————+———————+—————————+——————————+——————— | |
public | + | + | + | + | |
————————————+———————+—————————+——————————+——————— | |
protected | + | + | + | | |
————————————+———————+—————————+——————————+——————— | |
no modifier | + | + | | | |
————————————+———————+—————————+——————————+——————— | |
private | + | | | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void addPageTurnButton() { | |
View view = getLayoutInflater().inflate(R.layout.widget_page_turn, null); | |
/* | |
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( | |
RelativeLayout.LayoutParams.WRAP_CONTENT, | |
RelativeLayout.LayoutParams.WRAP_CONTENT); | |
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); | |
view.setLayoutParams(params); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by weiyi on 4/18/16. | |
*/ | |
public class MonitorService extends IntentService { | |
private static final String TAG = makeLogTag(MonitorService.class); | |
private static final int MONITOR_INTERVAL = 5 * 1000; | |
private Context mAppContext; | |
private Handler mHandler; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
<solid android:color="@color/white"/> | |
<padding | |
android:left="16dp" | |
android:top="4dp" | |
android:right="16dp" | |
android:bottom="4dp"/> | |
<corners | |
android:radius="2dp"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.SystemClock; | |
import android.view.View; | |
import java.util.Map; | |
import java.util.WeakHashMap; | |
// 源码基于 http://stackoverflow.com/questions/16534369/avoid-button-multiple-rapid-clicks | |
public abstract class OnMultipleClickListener implements View.OnClickListener { | |
private static final int DEFAULT_MAX_INTERVAL = 1000; // ms | |
private int mClickIndex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by weiyi on 3/28/16. | |
* http://li2.me/2016/03/android-spannablestring-example.html | |
* https://github.com/li2/Learning_Android_Open_Source/tree/master/AndroidTextSample | |
*/ | |
public class SpannableStringApiActivity extends AppCompatActivity { | |
@Bind(R.id.textView) TextView mTextView; | |
@Bind(R.id.spannableForegroundColor) TextView mForegroundColorTextView; | |
@Bind(R.id.spannableBackgroundColor) TextView mBackgroundColorTextView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* __ | |
Like this (|__| represents an image): | |
__ __ | |
|__| Settings - |__| Safety. | |
Get TextView height by OnGlobalLayoutListener dynamically, and then | |
set drawable size by calling drawable.set(left, top, right, bottom), | |
in order to make sure the height of drawable is same as the string. | |
http://stackoverflow.com/questions/3591784/getwidth-and-getheight-of-view-returns-0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From http://stackoverflow.com/questions/25628258/align-text-around-imagespan-center-vertical | |
public class CenteredImageSpan extends ImageSpan { | |
// Extra variables used to redefine the Font Metrics when an ImageSpan is added | |
private int initialDescent = 0; | |
private int extraSpace = 0; | |
public CenteredImageSpan(final Drawable drawable) { | |
this(drawable, entry, DynamicDrawableSpan.ALIGN_BOTTOM); |