--------------------------Database Login Signup--------------------------
-------------------------AppController.class-----------------------------
-------------------------AppController.class-----------------------------
package com.httpabcdefapp1123.databasenewlogin; import android.app.Application; import android.text.TextUtils; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.DiskBasedCache; import com.android.volley.toolbox.Volley; public class AppController extends Application { public static final String TAG = AppController.class.getSimpleName(); private RequestQueue mRequestQueue; private static AppController mInstance; DiskBasedCache cache; @Override public void onCreate() { super.onCreate(); mInstance = this; new LoginDataHelper(this); // new UserDetailDataHelper(this); // Create global configuration and initialize ImageLoader with this config } public DiskBasedCache getDiskCache() { if (cache == null) { cache = new DiskBasedCache(getExternalCacheDir(), 209715200); } return cache; } public static synchronized AppController getInstance() { return mInstance; } public RequestQueue getRequestQueue() { if (mRequestQueue == null) { mRequestQueue = Volley.newRequestQueue(getApplicationContext()); } return mRequestQueue; } public <T> void addToRequestQueue(Request<T> req, String tag) { req.setTag(TextUtils.isEmpty(tag) ? TAG : tag); getRequestQueue().add(req); } public <T> void addToRequestQueue(Request<T> req) { req.setTag(TAG); getRequestQueue().add(req); } public void cancelPendingRequests(Object tag) { if (mRequestQueue != null) { mRequestQueue.cancelAll(tag); } } }
-----------DataManager.class----------------
package com.httpabcdefapp1123.databasenewlogin; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public class DataManager extends SQLiteOpenHelper { public static final int DATABASE_VERSION = 3; public static final String DATABASE_NAME = "CollegeLife"; public DataManager(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, version); } @Override public void onCreate(SQLiteDatabase db) { LoginModel.creteTable(db); // UserDetailModel.creteTable(db); } @Override public void onUpgrade(SQLiteDatabase db, int paramInt1, int paramInt2) { LoginModel.dropTable(db); // UserDetailModel.dropTable(db);// SavedData.clear(); onCreate(db); } }
--------------------LoginDataHelper.class--------------
package com.httpabcdefapp1123.databasenewlogin; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.view.View; import java.util.ArrayList; /** * Created by Meenakshi on 21/03/2017. */ public class LoginDataHelper { private static LoginDataHelper instance; private SQLiteDatabase db; private DataManager dm; Context cx; public LoginDataHelper(Context cx) { instance = this; this.cx = cx; dm = new DataManager(cx, DataManager.DATABASE_NAME, null, DataManager.DATABASE_VERSION); } public static LoginDataHelper getInstance() { return instance; } public void open() { db = dm.getWritableDatabase(); } public void close() { db.close(); } public void read() { db = dm.getReadableDatabase(); } public void delete(String email) { open(); db.delete(LoginModel.TABLE_NAME, LoginModel.KEY_USER_EMAIL + " = '" + email + "'", null); // db.execSQL("DELETE FROM " + CartModel.TABLE_NAME + " WHERE " + CartModel.KEY_PACKAGE_ID + "= '" + packageId); close(); } public boolean isExist(String email) { Cursor clientCur = db.rawQuery("SELECT * FROM " + LoginModel.TABLE_NAME + " WHERE email = '" + email + "'", null); boolean exist = (clientCur.getCount() > 0); clientCur.close(); return exist; } public void insertClientDetail(LoginModel loginModel) { open(); ContentValues values = new ContentValues(); values.put(loginModel.KEY_USER_EMAIL, loginModel.getEmail()); values.put(loginModel.KEY_USER_PASSWORD, loginModel.getPassword()); values.put(loginModel.KEY_LOGIN_TYPE, loginModel.getLoginType()); if (!isExist(loginModel.getEmail())) db.insert(loginModel.TABLE_NAME, null, values); close(); } public void updateEntry(LoginModel loginModel) { // Define the updated row content. ContentValues updatedValues = new ContentValues(); // Assign values for each row. updatedValues.put(loginModel.KEY_USER_EMAIL, loginModel.getEmail()); updatedValues.put(loginModel.KEY_USER_PASSWORD, loginModel.getPassword()); updatedValues.put(loginModel.KEY_LOGIN_TYPE, loginModel.getLoginType()); String where = "EMAIL = ?"; db.update(loginModel.TABLE_NAME, updatedValues, where, new String[]{loginModel.getEmail()}); } public void updateClientDetail(LoginModel loginModel) { open(); ContentValues updatedValues = new ContentValues(); updatedValues.put(loginModel.KEY_USER_EMAIL, loginModel.getEmail()); updatedValues.put(loginModel.KEY_USER_PASSWORD, loginModel.getPassword()); updatedValues.put(loginModel.KEY_LOGIN_TYPE, loginModel.getLoginType()); String where = "EMAIL = ?"; db.update(loginModel.TABLE_NAME, updatedValues, " EMAIL = '" + loginModel.getEmail() + "'", null); close(); } public ArrayList<LoginModel> getLoginDetail() { ArrayList<LoginModel> userItem = new ArrayList<LoginModel>(); read(); Cursor clientCur = db.rawQuery("select * from LoginModel", null); if (clientCur != null && clientCur.getCount() > 0) { clientCur.moveToFirst(); do { LoginModel loginModel = new LoginModel(); loginModel.setEmail(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_USER_EMAIL))); loginModel.setPassword(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_USER_PASSWORD))); loginModel.setLoginType(clientCur.getString(clientCur.getColumnIndex(loginModel.KEY_LOGIN_TYPE))); userItem.add(loginModel); } while ((clientCur.moveToNext())); clientCur.close(); } close(); return userItem; } }
------------------------------LoginModel.class--------------
package com.httpabcdefapp1123.databasenewlogin; import android.database.sqlite.SQLiteDatabase; /** * Created by Meenakshi on 21/03/2017. */ public class LoginModel { public static final String TABLE_NAME = "LoginModel"; public static final String KEY_ID = "_id"; public static String KEY_USER_EMAIL = "email"; public static String KEY_USER_PASSWORD = "password"; public static String KEY_LOGIN_TYPE = "loginType"; public static void creteTable(SQLiteDatabase db) { String CREATE_CLIENTTABLE = "create table " + TABLE_NAME + " ("
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ KEY_USER_EMAIL + " text, " + KEY_USER_PASSWORD + " text, "
+ KEY_LOGIN_TYPE + " text " + ")"; db.execSQL(CREATE_CLIENTTABLE); } public static void dropTable(SQLiteDatabase db) { db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getLoginType() { return loginType; } public void setLoginType(String loginType) { this.loginType = loginType; } //setter gater private String email,password,loginType; }
----------------CarddetailActivity.Activity----------
package com.httpabcdefapp1123.databasenewlogin; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import java.util.ArrayList; import java.util.List; public class CarddetailActivity extends AppCompatActivity { EditText EmailEditTextView,PasswordEditTextView; Button UpdatedetailButton,DeletedetailButton; LoginDataHelper loginDataHelper; LoginModel loginModel;// List<LoginModel> arrayList=new ArrayList<>(); DataManager dataManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_carddetail); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); EmailEditTextView=(EditText)findViewById(R.id.EmailEditTextView); PasswordEditTextView=(EditText)findViewById(R.id.PasswordEditTextView); UpdatedetailButton = (Button) findViewById(R.id.UpdatedetailButton); DeletedetailButton = (Button)findViewById(R.id.DeletedetailButton); loginDataHelper = new LoginDataHelper(this); loginModel = new LoginModel(); UpdatedetailButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { LoginModel loginModel=new LoginModel(); loginModel.setEmail(EmailEditTextView.getText().toString()); loginModel.setPassword(PasswordEditTextView.getText().toString()); LoginDataHelper.getInstance().updateClientDetail(loginModel); startActivity(new Intent(CarddetailActivity.this, NewActivity.class)); } }); DeletedetailButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String email = EmailEditTextView.getText().toString(); LoginModel loginModel=new LoginModel(); loginModel.setEmail(EmailEditTextView.getText().toString()); loginModel.setPassword(PasswordEditTextView.getText().toString()); LoginDataHelper.getInstance().delete(email); startActivity(new Intent(CarddetailActivity.this, NewActivity.class)); } }); Intent in=getIntent(); String value=in.getStringExtra("key"); EmailEditTextView.setText(value); String values=in.getStringExtra("keys"); PasswordEditTextView.setText(values); } }
----------------------CardViewAdapter--------------------
package com.httpabcdefapp1123.databasenewlogin; import android.content.Context; import android.content.Intent; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.List; /** * Created by munnu on 09/03/2017. */ public class CardViewAdapter extends RecyclerView.Adapter<CardViewAdapter.MyViewHolder> { List<LoginModel> arrayList; Context context; LoginModel loginModel; // LoginDataHelper loginDataHelper; public CardViewAdapter(List<LoginModel> arrayList) { this.arrayList = arrayList; } public class MyViewHolder extends RecyclerView.ViewHolder { TextView EmailTextView, PasswordTextView; CardView card; public MyViewHolder(View view) { super(view); EmailTextView = (TextView) view.findViewById(R.id.EmailTextView); PasswordTextView = (TextView) view.findViewById(R.id.PasswordTextView); card=(CardView)view.findViewById(R.id.CardView); } } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { context = parent.getContext(); View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.cardviewadapter, parent, false); return new MyViewHolder(itemView); } @Override public void onBindViewHolder(MyViewHolder holder, final int position) { final LoginModel cardListObject = arrayList.get(position); holder.EmailTextView.setText(cardListObject.getEmail()); holder.PasswordTextView.setText(cardListObject.getPassword()); holder.card.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent=new Intent(context,CarddetailActivity.class); String value=cardListObject.getEmail().toString(); intent.putExtra("key",value); context.startActivity(intent); String values=cardListObject.getPassword().toString(); intent.putExtra("keys",values); context.startActivity(intent); } }); } @Override public int getItemCount() { return arrayList.size(); } }
------------------NewActivity.Activity---------------
package com.httpabcdefapp1123.databasenewlogin; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.CardView; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.EditText; import android.widget.TextView; import java.util.ArrayList; import java.util.List; public class NewActivity extends AppCompatActivity { private RecyclerView recyclerView; private CardViewAdapter cardViewAdapter; private CardView cardView; LoginModel loginModel; List<LoginModel> arrayList=new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); recyclerView = (RecyclerView) findViewById(R.id.RecyclerView); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext()); recyclerView.setLayoutManager(layoutManager); cardViewAdapter = new CardViewAdapter(arrayList); Log.e("Card List", " == " + arrayList.size()); recyclerView.setAdapter(cardViewAdapter); cardViewAdapter.notifyDataSetChanged(); } }
---------UserlogindetailActivity.Activity------
package com.httpabcdefapp1123.databasenewlogin; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class UserlogindetailActivity extends AppCompatActivity { EditText EmailEditTextView, PasswordEditTextView; Button LoginButton; LoginDataHelper loginDataHelper; LoginModel loginModel; String Email, Pass; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_detail); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); LoginButton=(Button)findViewById(R.id.LoginButton); LoginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { EmailEditTextView = (EditText) findViewById(R.id.EmailEditTextView); PasswordEditTextView = (EditText) findViewById(R.id.PasswordEditTextView); LoginButton = (Button) findViewById(R.id.LoginButton); loginDataHelper = new LoginDataHelper(UserlogindetailActivity.this); loginModel = new LoginModel(); LoginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { LoginModel loginModel = new LoginModel(); loginModel.setEmail(EmailEditTextView.getText().toString()); loginModel.setPassword(PasswordEditTextView.getText().toString()); LoginDataHelper.getInstance().insertClientDetail(loginModel); startActivity(new Intent(UserlogindetailActivity.this, NewActivity.class)); } }); } }); } }
-----------activity_carddetail.xml-----------
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.httpabcdefapp1123.databasenewlogin.CarddetailActivity"> <android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:background="#fa3232"
android:theme="@style/AppTheme.AppBarOverlay"> <android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay" /> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_carddetail" /> <android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end"
app:srcCompat="@android:drawable/ic_dialog_email" /> </android.support.design.widget.CoordinatorLayout>
----------activity_main.xml--------------------
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#a3fde8"
android:id="@+id/RecyclerView"> </android.support.v7.widget.RecyclerView> </RelativeLayout>
-----------activity_new.xml---------------------
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.httpabcdefapp1123.databasenewlogin.NewActivity"> <android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay" /> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_new" /> <android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end"
app:srcCompat="@android:drawable/ic_dialog_email" /> </android.support.design.widget.CoordinatorLayout>
----------------cardviewadapter.xml-----------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="200dp"> <android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:id="@+id/CardView"
app:cardCornerRadius="10dp"
android:elevation="10dp"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"> <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Email"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:id="@+id/EmailTextView"/> <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Password"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:id="@+id/PasswordTextView"/> </LinearLayout> </android.support.v7.widget.CardView> </LinearLayout>
------------------content_carddetail.xml----------------------------
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.httpabcdefapp1123.databasenewlogin.CarddetailActivity"
tools:showIn="@layout/activity_carddetail"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"> <EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/EmailEditTextView"
android:hint="Email"
android:layout_marginTop="35dp"
android:textSize="16sp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:ems="10"> <requestFocus /> </EditText> <EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/PasswordEditTextView"
android:hint="Password"
android:textSize="16sp"
android:layout_marginTop="0dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Updatedetail"
android:id="@+id/UpdatedetailButton"
android:layout_gravity="center" /> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Deletedetail"
android:id="@+id/DeletedetailButton"
android:layout_gravity="center" /> </LinearLayout> </android.support.v4.widget.NestedScrollView>
-----------------------content_new.xml---------------------------
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.httpabcdefapp1123.databasenewlogin.NewActivity"
tools:showIn="@layout/activity_new"> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView
android:id="@+id/RecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"> </android.support.v7.widget.RecyclerView> </RelativeLayout> </android.support.v4.widget.NestedScrollView>
-------------------login.xml--------------------------------
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.httpabcdefapp1123.databasenewlogin.UserlogindetailActivity"
tools:showIn="@layout/login_detail"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"> <EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/EmailEditTextView"
android:hint="Email"
android:layout_marginTop="35dp"
android:textSize="16sp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:ems="10"> <requestFocus /> </EditText> <EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/PasswordEditTextView"
android:hint="Password"
android:textSize="16sp"
android:layout_marginTop="0dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login"
android:id="@+id/LoginButton"
android:layout_gravity="center" /> </LinearLayout> </android.support.v4.widget.NestedScrollView>
---------------------------login_detail.xml----------------------------
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"> <android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay"> <android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay" /> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <include layout="@layout/login" /> <android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end"
app:srcCompat="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
----------------------menu add you---------------------------
--------------------------Dependency add-----------------
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
testCompile 'junit:junit:4.12'
compile 'com.android.volley:volley:1.0.0'
compile 'com.afollestad.material-dialogs:core:0.9.4.1'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.android.support:cardview-v7:25.0.1'
No comments:
Post a Comment