Skip to content

Commit

Permalink
Merge branch 'androidx'
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/build.gradle
#	build.gradle
#	canrefresh/build.gradle
#	canrefresh/src/main/java/com/canyinghao/canrefresh/CanRefreshLayout.java
#	gradle.properties
#	gradle/wrapper/gradle-wrapper.properties
  • Loading branch information
canyinghao committed May 31, 2021
2 parents ee96620 + 2736098 commit 2070079
Show file tree
Hide file tree
Showing 41 changed files with 414 additions and 361 deletions.
23 changes: 11 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
apply plugin: 'com.android.application'
//apply plugin: 'android-apt'
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
applicationId "com.canyinghao.canrefreshdemo"
minSdkVersion 24
targetSdkVersion 26
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Expand All @@ -25,14 +23,15 @@ repositories {
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.canyinghao:canadapter:1.3.1'
implementation 'com.jakewharton:butterknife:9.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0'
implementation 'com.canyinghao:canrecyclerview:1.1.5'
implementation project(':canrefresh')
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
compile 'com.canyinghao:canadapter:5.0.0'

compile 'com.canyinghao:canrecyclerview:5.0.0'
compile project(':canrefresh')


}
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
package com.canyinghao.canrefreshdemo.ui;

import android.app.Activity;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.canyinghao.canrefreshdemo.R;

import java.lang.reflect.Field;

import butterknife.Unbinder;


public abstract class BaseFragment extends Fragment {
Expand All @@ -27,7 +20,7 @@ public abstract class BaseFragment extends Fragment {

public LayoutInflater mInflater;

protected Unbinder unbinder;


@Override
public void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -106,10 +99,7 @@ public View getRootView() {

@Override
public void onDestroy() {
if (unbinder != null) {
unbinder.unbind();
unbinder = null;
}

super.onDestroy();
context = null;
mInflater = null;
Expand Down
47 changes: 27 additions & 20 deletions app/src/main/java/com/canyinghao/canrefreshdemo/ui/CooActivity.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
package com.canyinghao.canrefreshdemo.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;

import com.canyinghao.canadapter.CanHolderHelper;
Expand All @@ -18,41 +10,56 @@
import com.canyinghao.canrefresh.shapeloading.ShapeLoadingRefreshView;
import com.canyinghao.canrefreshdemo.R;
import com.canyinghao.canrefreshdemo.model.MainBean;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
* Created by canyinghao on 16/6/29.
*/
public class CooActivity extends AppCompatActivity implements CanRefreshLayout.OnRefreshListener, CanRefreshLayout.OnLoadMoreListener {


@BindView(R.id.can_refresh_footer)

RotateRefreshView canRefreshFooter;
@BindView(R.id.header)

ImageView header;
@BindView(R.id.toolbar)

Toolbar toolbar;
@BindView(R.id.toolbarlayout)

CollapsingToolbarLayout toolbarlayout;
@BindView(R.id.appbar)

AppBarLayout appbar;
@BindView(R.id.can_scroll_view)

RecyclerView recyclerView;
@BindView(R.id.can_content_view)

CoordinatorLayout canContentView;
@BindView(R.id.refresh)

CanRefreshLayout refresh;
CanRVAdapter adapter;
@BindView(R.id.can_refresh_header)

ShapeLoadingRefreshView canRefreshHeader;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_coo);
ButterKnife.bind(this);
canRefreshFooter = findViewById(R.id.can_refresh_footer);
header = findViewById(R.id.header);
toolbar = findViewById(R.id.toolbar);
toolbarlayout = findViewById(R.id.toolbarlayout);
appbar = findViewById(R.id.appbar);
recyclerView = findViewById(R.id.can_scroll_view);
canContentView = findViewById(R.id.can_content_view);
refresh = findViewById(R.id.refresh);
canRefreshHeader = findViewById(R.id.can_refresh_header);


refresh.setOnLoadMoreListener(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,65 +1,70 @@
package com.canyinghao.canrefreshdemo.ui;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;

import com.canyinghao.canadapter.CanHolderHelper;
import com.canyinghao.canadapter.CanRVAdapter;
import com.canyinghao.canrefresh.CanRefreshLayout;
import com.canyinghao.canrefresh.classic.RotateRefreshView;
import com.canyinghao.canrefresh.shapeloading.ShapeLoadingRefreshView;
import com.canyinghao.canrefreshdemo.R;
import com.canyinghao.canrefreshdemo.model.MainBean;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;


/**
* Created by canyinghao on 16/6/29.
*/
public class CooActivity2 extends AppCompatActivity implements CanRefreshLayout.OnRefreshListener, CanRefreshLayout.OnLoadMoreListener {


@BindView(R.id.can_refresh_footer)

RotateRefreshView canRefreshFooter;
@BindView(R.id.header)

ImageView header;
@BindView(R.id.toolbar)

Toolbar toolbar;
@BindView(R.id.toolbarlayout)

CollapsingToolbarLayout toolbarlayout;
@BindView(R.id.appbar)

AppBarLayout appbar;
@BindView(R.id.can_scroll_view)

ViewPager viewPager;
@BindView(R.id.can_content_view)

CoordinatorLayout canContentView;
@BindView(R.id.refresh)

CanRefreshLayout refresh;

@BindView(R.id.can_refresh_header)

ShapeLoadingRefreshView canRefreshHeader;

@SuppressLint("WrongViewCast")
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_coo2);
ButterKnife.bind(this);

canRefreshFooter = findViewById(R.id.can_refresh_footer);
header = findViewById(R.id.header);
toolbar = findViewById(R.id.toolbar);
toolbarlayout = findViewById(R.id.toolbarlayout);
appbar = findViewById(R.id.appbar);
viewPager = findViewById(R.id.can_scroll_view);
canContentView = findViewById(R.id.can_content_view);
refresh = findViewById(R.id.refresh);
canRefreshHeader = findViewById(R.id.can_refresh_header);


refresh.setOnLoadMoreListener(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -20,16 +18,16 @@
import com.canyinghao.canrefresh.yalantis.YalantisPhoenixRefreshView;
import com.canyinghao.canrefreshdemo.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;


/**
* Created by canyinghao on 16/1/24.
*/
public class CustomActivity extends AppCompatActivity implements CanRefreshLayout.OnRefreshListener, CanRefreshLayout.OnLoadMoreListener{

@BindView(R.id.refresh)

CanRefreshLayout refresh;

int headStyle;
Expand All @@ -48,7 +46,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_linear);

ButterKnife.bind(this);
refresh = findViewById(R.id.refresh);

context =this;
initView();
Expand All @@ -63,18 +61,19 @@ private void initView() {
refresh.setOnLoadMoreListener(this);
refresh.setOnRefreshListener(this);

findViewById(R.id.iv).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showConfigDialog();
}
});

// showConfigDialog();
}


@OnClick({R.id.iv})
public void click(View v){

showConfigDialog();


}


private void showConfigDialog() {
if (dialog == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package com.canyinghao.canrefreshdemo.ui;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.canyinghao.canrefresh.CanRefreshLayout;
import com.canyinghao.canrefreshdemo.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import androidx.fragment.app.Fragment;


/**
Expand All @@ -19,7 +17,7 @@
public class LinearLayoutFragment extends Fragment implements CanRefreshLayout.OnRefreshListener, CanRefreshLayout.OnLoadMoreListener {


@BindView(R.id.refresh)

CanRefreshLayout refresh;


Expand All @@ -30,7 +28,7 @@ public class LinearLayoutFragment extends Fragment implements CanRefreshLayout.O
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_linear, container, false);
ButterKnife.bind(this, v);
refresh = v.findViewById(R.id.refresh);
initView(v);
return v;
}
Expand Down
Loading

0 comments on commit 2070079

Please sign in to comment.