Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.
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
36 changes: 18 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '26.0.3'
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.google.android.perftesting"
minSdkVersion 14
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testHandleProfiling true
testFunctionalTest true
}
Expand All @@ -32,20 +32,20 @@ android {
}

dependencies {
String supportLibVersion = "27.0.2"
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:recyclerview-v7:${supportLibVersion}"
compile "com.android.support:support-v4:${supportLibVersion}"
compile 'com.github.bumptech.glide:glide:3.8.0'
// TODO(developer): Comment in the following dependencies to enable Espresso and related libraries in this project.
// Force the use of a specific version of the annotations library because the app compile
// dependencies require this version transitively, but an androidTestCompile dependency
// requires a different version. See http://goo.gl/iH4WDq for more info.
// androidTestCompile "com.android.support:support-annotations:${supportLibVersion}"
// androidTestCompile 'com.android.support.test:runner:0.5'
// androidTestCompile 'com.android.support.test:rules:0.5'
// androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:1.0.2"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'com.github.bumptech.glide:glide:4.8.0'
// TODO(developer): Comment in the following dependencies to enable Espresso and related libraries in this project.
// Force the use of a specific version of the annotations library because the app compile
// dependencies require this version transitively, but an androidTestCompile dependency
// requires a different version. See http://goo.gl/iH4WDq for more info.

androidTestImplementation "androidx.annotation:annotation:1.0.0"
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

// Create performance testing tasks for all connected Android devices using a Gradle plugin defined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.google.android.perftesting;

import android.content.Context;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.Log;

import com.google.android.perftesting.common.PerfTestingUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;

public class MainActivity extends AppCompatActivity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.google.android.perftesting;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package com.google.android.perftesting;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.google.android.perftesting.contacts.Contact;
import com.google.android.perftesting.contacts.ContactsRecyclerAdapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.google.android.perftesting;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.widget.ListView;

import com.google.android.perftesting.contacts.Contact;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.request.RequestOptions;
import com.google.android.perftesting.R;

import com.bumptech.glide.Glide;
Expand All @@ -41,8 +42,8 @@ public ContactsArrayAdapterFixed(Context context, List<Contact> contacts) {
super(context, 0, contacts);
}

@ Override
public View getView(int position, View convertView, ViewGroup parent ) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {

Contact contact = getItem(position);
LayoutInflater inflater = LayoutInflater.from(getContext());
Expand All @@ -56,7 +57,8 @@ public View getView(int position, View convertView, ViewGroup parent ) {

Glide.with(contactImage.getContext())
.load(R.drawable.bbq)
.fitCenter()
.apply(new RequestOptions()
.fitCenter())
.into(contactImage);

contactName.setText(contact.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
package com.google.android.perftesting.contacts;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.request.RequestOptions;
import com.google.android.perftesting.R;

import com.bumptech.glide.Glide;
Expand Down Expand Up @@ -63,7 +64,8 @@ public void onBindViewHolder(ViewHolder holder, int position) {
textView.setText(contact.getName());
Glide.with(contactPic.getContext())
.load(R.drawable.bbq)
.fitCenter()
.apply(new RequestOptions()
.fitCenter())
.into(contactPic);
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_recyclerview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
xmlns:tools="http://schemas.android.com/tools"
tools:context=".RecyclerViewActivity">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/contactList"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.4.0-alpha05'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
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 Jan 19 15:00:17 WET 2018
#Tue Nov 27 12:59:21 EET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-rc-1-all.zip