Проект Android не запускается через индикатор страницы и CirclePageIndicator - PullRequest
0 голосов
/ 12 ноября 2018

Я пишу код для студии Android, и мне нужны Page Indicator и viewpagerindicator.CirclePageIndicator, но они сообщают мне об ошибках, поэтому я не могу скомпилировать свой код. Мне нужно, чтобы у каждого фрагмента были индикаторы внизу Если у вас есть простой способ сделать это, просто дайте мне знать, потому что я 2 дня искал, как сделать для каждой страницы с индикаторами Я пробовал это с GitHub, но не работает.

https://github.com/vivchar/ViewPagerIndicator

Это мой код в сборке Gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.zhuniqia.searchfinal"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}



buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

это основной xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FF000000"
    android:orientation="vertical"
    tools:context=".MainActivity">
    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"/>
    <viewpagerindicator.CirclePageIndicator
        android:id="@+id/pagerIndicator"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="5dp"
        android:layout_marginTop="5dp"
        android:padding="3dp"/>



</LinearLayout>

Это Java

public PageIndicator indicator;

1 Ответ

0 голосов
/ 12 ноября 2018

Gradle

Шаг 1. Добавьте JitPack-репозиторий в файл сборки

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Шаг 2. Добавьте зависимость

dependencies {
    implementation 'com.github.vivchar:ViewPagerIndicator:${LATEST_VERSION}'
}

Я не вижуэти зависимости в файле build.gradle. Кроме того, прочитайте еще раз и следуйте инструкциям из файла README по ссылке, которой вы поделились.

...