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
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
// https://stackoverflow.com/a/38847374/2722270 | |
public abstract class BasicServiceActivity extends AppCompatActivity { | |
protected DvrService mDvrService; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_basic); | |
attachService(); |
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"?> | |
<RelativeLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fitsSystemWindows="true"> | |
<include | |
layout="@layout/toolbar_actionbar" |
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"?> | |
<android.support.design.widget.AppBarLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/topActionbarLayout" | |
android:layout_height="wrap_content" | |
android:layout_width="match_parent" | |
android:elevation="@dimen/elevation_header"> | |
<android.support.v7.widget.Toolbar |
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.li on 2/19/16 | |
* li2.me/2016/08/make-a-reusable-ui-in-android-app-development.html | |
*/ | |
public abstract class BasicActivity extends AppCompatActivity { | |
protected TextView mActionTitleView; | |
protected TextView mActionBackBtn; | |
protected Button mActionCloseBtn; | |
protected Fragment mContentFragment; |
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.li on 2/19/16. | |
* http://li2.me/2016/08/make-a-reusable-ui-in-android-app-development.html | |
*/ | |
public abstract class BasicOperationActivity extends BasicActivity { | |
private ToggleButton mOperationBtn1; | |
private ToggleButton mOperationBtn2; | |
/** Override this method to inflate bottom toolbar layout. */ | |
@Override |
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 2/23/16. | |
* http://li2.me/2016/08/make-a-reusable-ui-in-android-app-development.html | |
*/ | |
public class SingleFragmentActivtiy extends BasicActivity { | |
@Override | |
protected String getActionBarTitle() { | |
return "Single Fragment Activity"; | |
} |
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.li on 4/7/16. | |
* This activity includes {@link AlbumFragment} and {@link ThumbnailFragment}. | |
*/ | |
public class TwoFragmentsActivity extends BasicOperationActivity { | |
private boolean mShowingThumbnail = true; | |
@Dvr.DvrFolder private int mFolderType = Dvr.DVR_FOLDER_LOOPED_VIDEOS; | |
private FragmentManager mFm; | |
private AlbumFragment mAlbumFragment; | |
private ThumbnailFragment mThumbnailFragment; |
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
/** | |
* Convert the dps to pixels, based on density scale | |
* @param dp value expressed in dps | |
* @return value expressed in pixels | |
*/ | |
public int dpToPixel(int dp) { | |
// Get the screen's density scale | |
float scale = getResources().getDisplayMetrics().density; | |
// Add 0.5f to round the figure up to the nearest whole number | |
return (int) (dp * scale + 0.5f); |