Commit 4647c296 authored by Sajal Narang's avatar Sajal Narang

Remove ConstraintLayout, fix crash

parent 379b1157
...@@ -122,6 +122,7 @@ public class LoginActivity extends AppCompatActivity { ...@@ -122,6 +122,7 @@ public class LoginActivity extends AppCompatActivity {
"AuthCode: " + response.authorizationCode, Toast.LENGTH_SHORT) "AuthCode: " + response.authorizationCode, Toast.LENGTH_SHORT)
.show(); .show();
// TODO: Replace gcmId
login(response.authorizationCode, "xyz"); login(response.authorizationCode, "xyz");
} else { } else {
Log.i(TAG, "Authorization failed: " + error.getMessage()); Log.i(TAG, "Authorization failed: " + error.getMessage());
...@@ -174,6 +175,7 @@ public class LoginActivity extends AppCompatActivity { ...@@ -174,6 +175,7 @@ public class LoginActivity extends AppCompatActivity {
@Override @Override
public void onResponse(Call<LoginResponse> call, Response<LoginResponse> response) { public void onResponse(Call<LoginResponse> call, Response<LoginResponse> response) {
if (response.isSuccessful()) { if (response.isSuccessful()) {
//Save credentials in AccountManager to keep user logged in
//Go to MainActivity //Go to MainActivity
} }
//Server error //Server error
......
...@@ -140,7 +140,7 @@ public class MainActivity extends AppCompatActivity ...@@ -140,7 +140,7 @@ public class MainActivity extends AppCompatActivity
private void updateFragment(Fragment fragment) { private void updateFragment(Fragment fragment) {
FragmentManager manager = getSupportFragmentManager(); FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction(); FragmentTransaction transaction = manager.beginTransaction();
transaction.replace(R.id.constraintlayout_for_fragment, fragment, fragment.getTag()); transaction.replace(R.id.framelayout_for_fragment, fragment, fragment.getTag());
transaction.commit(); transaction.commit();
} }
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/constraintlayout_for_fragment" android:id="@+id/framelayout_for_fragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_behavior="@string/appbar_scrolling_view_behavior"
......
...@@ -7,7 +7,7 @@ buildscript { ...@@ -7,7 +7,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha5' classpath 'com.android.tools.build:gradle:3.0.0-alpha6'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment