Android Pull-to-Refresh with ListView snippet and ListView custom adapter

I built my project using Android Studio startup options (automatically creates action barwith tabs), so a bit is created for me. However, I used list-view fragmentfor each of the tabs in which the custom one is used adapters.

I'm having trouble adding lib-to-refresh lib from Chris Bane . Maybe I'm importing it wrong? I am new to Android development and especially with this new Gradle stuff.

I import the github repository in the build.gradle file here:

apply plugin: 'android'

android {
compileSdkVersion 19
buildToolsVersion "19.0.1"

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
  }
}
dependencies {
   compile 'com.android.support:support-v4:19.0.1'
   compile 'com.android.support:appcompat-v7:19.0.1'
   compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abc:+'
 } 

minSDKVersion, . build.gradle , `/app.

Gradle , git .idea- .

:

github repo " "

, , PullToRefreshLayout:

:

<uk.co.senab.actionbarpulltorefresh.extras.actionbarcompat.PullToRefreshLayout>
<listview/>
</uk.co.senab.actionbarpulltorefresh.extras.actionbarcompat.PullToRefreshLayout>

uk.co.senab.actionbarpulltorefresh.extras , com.lucaapp.app?

XML ListFragment, :

<?xml version="1.0" encoding="utf-8"?>

<com.lucaapp.app.PullToRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/ptr_layout" >


<ListView
    android:id="@android:id/list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:divider="#b5b5b5"
    android:dividerHeight="1dp"
    android:listSelector="@drawable/list_selector" />


<TextView
    android:id="@android:id/empty"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:text="No Events" />

</com.lucaapp.app.PullToRefreshLayout>

, quick start guide . Cannot Resolve Symbol, github repo.

, Cannot Resolve Symbol:

import com.lucapp.app.PullToRefreshAttacher;
import com.lucapp.app.PullToRefreshLayout;
import uk.co.senab.actionbarpulltorefresh.extras.actionbarcompat.PullToRefreshAttacher;

, , ( ), , , , . , , .

+4
2

: https://github.com/chrisbanes/ActionBar-PullToRefresh/wiki/QuickStart-ABS

, build.gradle .

: ScrollView ( ListView, ). . ScrollView ListView, .

: :

<uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ptr_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Your content, here we're using a ScrollView -->

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ScrollView>

</uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshLayout>

com.lucaapp.app.PullToRefreshLayout uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshLayout

0

Swipe . , devloper

+1

Source: https://habr.com/ru/post/1532722/


All Articles