Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings addressed and lib version update #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ local.properties
build/
.gradle/
.idea
*.iml
*.iml

#Other
captures
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
buildToolsVersion "26.0.1"

defaultConfig {
applicationId "com.support.android.designlibdemo"
Expand All @@ -21,8 +21,8 @@ android {
}

dependencies {
implementation 'com.android.support:design:26.0.0-beta2'
implementation 'com.android.support:cardview-v7:26.0.0-beta2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'

implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'de.hdodenhof:circleimageview:1.3.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import java.util.Random;

public class CheeseDetailActivity extends AppCompatActivity {

public static final String EXTRA_NAME = "cheese_name";
Expand All @@ -41,19 +39,23 @@ public void onCreate(Bundle savedInstanceState) {
Intent intent = getIntent();
final String cheeseName = intent.getStringExtra(EXTRA_NAME);

final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
final Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

final ActionBar ab = getSupportActionBar();
if(ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
}

CollapsingToolbarLayout collapsingToolbar =
(CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
findViewById(R.id.collapsing_toolbar);
collapsingToolbar.setTitle(cheeseName);

loadBackdrop();
}

private void loadBackdrop() {
final ImageView imageView = (ImageView) findViewById(R.id.backdrop);
final ImageView imageView = findViewById(R.id.backdrop);
Glide.with(this).load(Cheeses.getRandomCheeseDrawable()).centerCrop().into(imageView);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -54,26 +51,28 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

final ActionBar ab = getSupportActionBar();
ab.setHomeAsUpIndicator(R.drawable.ic_menu);
ab.setDisplayHomeAsUpEnabled(true);
if (ab != null) {
ab.setHomeAsUpIndicator(R.drawable.ic_menu);
ab.setDisplayHomeAsUpEnabled(true);
}

mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerLayout = findViewById(R.id.drawer_layout);

NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
NavigationView navigationView = findViewById(R.id.nav_view);
if (navigationView != null) {
setupDrawerContent(navigationView);
}

ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
ViewPager viewPager = findViewById(R.id.viewpager);
if (viewPager != null) {
setupViewPager(viewPager);
}

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand All @@ -82,7 +81,7 @@ public void onClick(View view) {
}
});

TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
TabLayout tabLayout = findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
}

Expand Down
7 changes: 5 additions & 2 deletions app/src/main/res/layout/activity_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<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:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -45,7 +46,8 @@
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax" />
app:layout_collapseMode="parallax"
tools:ignore="ContentDescription" />

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
Expand Down Expand Up @@ -159,6 +161,7 @@
app:layout_anchorGravity="bottom|right|end"
android:src="@drawable/ic_discuss"
android:layout_margin="@dimen/fab_margin"
android:clickable="true"/>
android:clickable="true"
android:focusable="true"/>

</android.support.design.widget.CoordinatorLayout>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
android:id="@+id/avatar"
android:layout_width="@dimen/list_item_avatar_size"
android:layout_height="@dimen/list_item_avatar_size"
android:layout_marginRight="16dp"/>
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp" />

<TextView
android:id="@android:id/text1"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha6'
classpath 'com.android.tools.build:gradle:3.0.0-beta4'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 09 10:31:39 BST 2017
#Sat Oct 07 14:30:40 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip