Skip to content

Instantly share code, notes, and snippets.

View janishar's full-sized avatar
:octocat:
Enthusiastically Curious

Janishar Ali janishar

:octocat:
Enthusiastically Curious
View GitHub Profile
@janishar
janishar / placeholverview-dependency.gradle
Last active October 10, 2016 10:19
PlaceHolverView Dependency
dependencies {
compile 'com.mindorks:placeholderview:0.2.7'
}
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="drawerArrowStyle">@style/MaterialDrawer.DrawerArrowStyle</item>
</style>
<!--use item name="drawerArrowStyle" if you are using dark primaryColor in your app, else remove it-->
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="178dp"
android:orientation="vertical"
android:background="@color/colorPrimary"
android:paddingLeft="30dp">
<ImageView
android:id="@+id/profileImageView"
android:layout_width="50dp"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainView"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center|left"
android:paddingLeft="20dp">
<ImageView
android:id="@+id/itemIcon"
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimaryDark">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
@NonReusable
@Layout(R.layout.drawer_header)
public class DrawerHeader {
@View(R.id.profileImageView)
private ImageView profileImage;
@View(R.id.nameTxt)
private TextView nameTxt;
@Layout(R.layout.drawer_item)
public class DrawerMenuItem {
public static final int DRAWER_MENU_ITEM_PROFILE = 1;
public static final int DRAWER_MENU_ITEM_REQUESTS = 2;
public static final int DRAWER_MENU_ITEM_GROUPS = 3;
public static final int DRAWER_MENU_ITEM_MESSAGE = 4;
public static final int DRAWER_MENU_ITEM_NOTIFICATIONS = 5;
public static final int DRAWER_MENU_ITEM_SETTINGS = 6;
public static final int DRAWER_MENU_ITEM_TERMS = 7;
public class MainActivity extends AppCompatActivity {
private PlaceHolderView mDrawerView;
private DrawerLayout mDrawer;
private Toolbar mToolbar;
private PlaceHolderView mGalleryView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);