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

update sdk and dependencies to build success #7

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
22 changes: 11 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
applicationId "me.kaede.androidmvppattern"
minSdkVersion 15
targetSdkVersion 22
minSdkVersion 22
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
Expand All @@ -20,12 +20,12 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:recyclerview-v7:+'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
implementation 'com.squareup.leakcanary:leakcanary-android:1.3.1'
// implementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
}
6 changes: 4 additions & 2 deletions app/src/main/java/me/kaede/mvp/eventbus/EventBusActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;

import androidx.appcompat.app.AppCompatActivity;

import de.greenrobot.event.EventBus;
import me.kaede.mvp.R;
import me.kaede.mvp.eventbus.event.GetDatasEvent;
Expand All @@ -18,7 +20,7 @@
import java.util.ArrayList;
import java.util.List;

public class EventBusActivity extends ActionBarActivity implements AdapterView.OnItemClickListener,IEventBusView {
public class EventBusActivity extends AppCompatActivity implements AdapterView.OnItemClickListener,IEventBusView {

private IEventBusPresenter iEventBusPresenter;
List<String> datas = new ArrayList<>();
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/me/kaede/mvp/fragment/DemoFragment.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package me.kaede.mvp.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
17 changes: 10 additions & 7 deletions app/src/main/java/me/kaede/mvp/fragment/FragmentsActivity.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package me.kaede.mvp.fragment;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.ViewPager;

import com.google.android.material.tabs.TabLayout;

import me.kaede.mvp.R;
import me.kaede.mvp.fragment.presenter.ActivityPresenterCompl;
import me.kaede.mvp.fragment.presenter.IActivityPresenter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package me.kaede.mvp.fragment.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import me.kaede.mvp.R;
import me.kaede.mvp.fragment.presenter.IFragmentPresenter;

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/me/kaede/mvp/home/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.*;
import android.widget.*;
import me.kaede.mvp.R;
Expand All @@ -14,7 +14,7 @@
import java.util.ArrayList;
import java.util.List;

public class HomeActivity extends ActionBarActivity implements AdapterView.OnItemClickListener,IHomeView {
public class HomeActivity extends AppCompatActivity implements AdapterView.OnItemClickListener,IHomeView {

private ListView listView;
private IHomePresenter homePresenter;
Expand All @@ -35,7 +35,7 @@ protected void onCreate(Bundle savedInstanceState) {
//init
View loadingView = LayoutInflater.from(this).inflate(R.layout.item_empty_view, null);
ViewGroup viewGroup = (ViewGroup) this.findViewById(R.id.layout_home);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,RelativeLayout.LayoutParams.MATCH_PARENT);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
viewGroup.addView(loadingView, layoutParams);
listView.setEmptyView(loadingView);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/me/kaede/mvp/login/LoginActivity.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package me.kaede.mvp.login;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import me.kaede.mvp.R;
import me.kaede.mvp.login.presenter.ILoginPresenter;
import me.kaede.mvp.login.presenter.LoginPresenterCompl;
import me.kaede.mvp.login.view.ILoginView;


public class LoginActivity extends ActionBarActivity implements ILoginView, View.OnClickListener {
public class LoginActivity extends AppCompatActivity implements ILoginView, View.OnClickListener {

private EditText editUser;
private EditText editPass;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.kaede.mvp.loginoptimized;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
Expand All @@ -13,7 +13,7 @@
import me.kaede.mvp.loginoptimized.view.ILoginView;


public class LoginOptimizedActivity extends ActionBarActivity implements ILoginView, View.OnClickListener {
public class LoginOptimizedActivity extends AppCompatActivity implements ILoginView, View.OnClickListener {

private EditText editUser;
private EditText editPass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -18,7 +18,7 @@

import java.util.List;

public class AdapterActivityA extends ActionBarActivity implements IAdapterView, AdapterView.OnItemClickListener {
public class AdapterActivityA extends AppCompatActivity implements IAdapterView, AdapterView.OnItemClickListener {

private ListView listView;
private View footerViewVisible;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -18,7 +18,7 @@

import java.util.List;

public class AdapterActivityB extends ActionBarActivity implements IAdapterView, AdapterView.OnItemClickListener {
public class AdapterActivityB extends AppCompatActivity implements IAdapterView, AdapterView.OnItemClickListener {

private ListView listView;
private View footerViewVisible;
Expand Down
18 changes: 11 additions & 7 deletions app/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layout_home"
tools:context="me.kaede.mvp.home.HomeActivity">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layout_home"
tools:context="me.kaede.mvp.home.HomeActivity">

<ListView android:id="@+id/list_home" android:layout_width="match_parent" android:layout_height="match_parent"></ListView>
<ListView
android:id="@+id/list_home"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
4 changes: 3 additions & 1 deletion app/src/main/res/layout/item_empty_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="match_parent">
<ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</LinearLayout>
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'com.android.tools.build:gradle:7.0.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,5 +17,6 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip