Project android fails to run over Page Indicator and CirclePageIndicator












1















I am writing a code for Android studio and I need Page Indicator and viewpagerindicator.CirclePageIndicator but these are telling me errors so I cannot compile my code.
I need for every Fragment to have indicicators in the bottom
If you have an simple way to do that just let me know because I have 2 days searched how to make for each page with indicators
I have tried this from github but doesn't work.



https://github.com/vivchar/ViewPagerIndicator



This is my code in build 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
}


this is the main 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>


This is the Java



public PageIndicator indicator;









share|improve this question





























    1















    I am writing a code for Android studio and I need Page Indicator and viewpagerindicator.CirclePageIndicator but these are telling me errors so I cannot compile my code.
    I need for every Fragment to have indicicators in the bottom
    If you have an simple way to do that just let me know because I have 2 days searched how to make for each page with indicators
    I have tried this from github but doesn't work.



    https://github.com/vivchar/ViewPagerIndicator



    This is my code in build 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
    }


    this is the main 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>


    This is the Java



    public PageIndicator indicator;









    share|improve this question



























      1












      1








      1








      I am writing a code for Android studio and I need Page Indicator and viewpagerindicator.CirclePageIndicator but these are telling me errors so I cannot compile my code.
      I need for every Fragment to have indicicators in the bottom
      If you have an simple way to do that just let me know because I have 2 days searched how to make for each page with indicators
      I have tried this from github but doesn't work.



      https://github.com/vivchar/ViewPagerIndicator



      This is my code in build 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
      }


      this is the main 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>


      This is the Java



      public PageIndicator indicator;









      share|improve this question
















      I am writing a code for Android studio and I need Page Indicator and viewpagerindicator.CirclePageIndicator but these are telling me errors so I cannot compile my code.
      I need for every Fragment to have indicicators in the bottom
      If you have an simple way to do that just let me know because I have 2 days searched how to make for each page with indicators
      I have tried this from github but doesn't work.



      https://github.com/vivchar/ViewPagerIndicator



      This is my code in build 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
      }


      this is the main 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>


      This is the Java



      public PageIndicator indicator;






      android dependencies






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '18 at 19:55







      Spritzig

















      asked Nov 12 '18 at 19:49









      SpritzigSpritzig

      201215




      201215
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Gradle



          Step 1. Add the JitPack repository to your build file



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


          Step 2. Add the dependency



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


          I don't see these dependecies in your build.gradle file.Also,read again and follow the steps from the README file from the link you've shared.






          share|improve this answer
























          • I am facing with problem Could not get unknown property 'LATEST_VERSION' for object of type org.gradle.api.internal.artifacts

            – Spritzig
            Nov 12 '18 at 21:19






          • 1





            Change LATEST_VERSION with 1.1.0. I mean , dependencies { implementation 'com.github.vivchar:ViewPagerIndicator:1.1.0' }

            – Miruna Radu
            Nov 13 '18 at 9:09













          • I have this fixed but do you have any idea to change the color of the ViewPagerIndicator ?

            – Spritzig
            Nov 13 '18 at 11:33






          • 1





            Try with : app:itemSelectedTint = "#color" and app:itemTint = "#anothercolor"

            – Miruna Radu
            Nov 13 '18 at 11:48






          • 1





            Your layout should contain this view : <com.github.vivchar.viewpagerindicator.ViewPagerIndicator android:id = "@+id/view_pager_indicator" android:layout_width = "wrap_content" android:layout_height = "wrap_content" app:itemSelectedTint = "@color/colorAccent" app:itemSize = "16dp" app:itemTint = "@color/colorPrimary" />

            – Miruna Radu
            Nov 13 '18 at 15:52











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269133%2fproject-android-fails-to-run-over-page-indicator-and-circlepageindicator%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Gradle



          Step 1. Add the JitPack repository to your build file



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


          Step 2. Add the dependency



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


          I don't see these dependecies in your build.gradle file.Also,read again and follow the steps from the README file from the link you've shared.






          share|improve this answer
























          • I am facing with problem Could not get unknown property 'LATEST_VERSION' for object of type org.gradle.api.internal.artifacts

            – Spritzig
            Nov 12 '18 at 21:19






          • 1





            Change LATEST_VERSION with 1.1.0. I mean , dependencies { implementation 'com.github.vivchar:ViewPagerIndicator:1.1.0' }

            – Miruna Radu
            Nov 13 '18 at 9:09













          • I have this fixed but do you have any idea to change the color of the ViewPagerIndicator ?

            – Spritzig
            Nov 13 '18 at 11:33






          • 1





            Try with : app:itemSelectedTint = "#color" and app:itemTint = "#anothercolor"

            – Miruna Radu
            Nov 13 '18 at 11:48






          • 1





            Your layout should contain this view : <com.github.vivchar.viewpagerindicator.ViewPagerIndicator android:id = "@+id/view_pager_indicator" android:layout_width = "wrap_content" android:layout_height = "wrap_content" app:itemSelectedTint = "@color/colorAccent" app:itemSize = "16dp" app:itemTint = "@color/colorPrimary" />

            – Miruna Radu
            Nov 13 '18 at 15:52
















          1














          Gradle



          Step 1. Add the JitPack repository to your build file



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


          Step 2. Add the dependency



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


          I don't see these dependecies in your build.gradle file.Also,read again and follow the steps from the README file from the link you've shared.






          share|improve this answer
























          • I am facing with problem Could not get unknown property 'LATEST_VERSION' for object of type org.gradle.api.internal.artifacts

            – Spritzig
            Nov 12 '18 at 21:19






          • 1





            Change LATEST_VERSION with 1.1.0. I mean , dependencies { implementation 'com.github.vivchar:ViewPagerIndicator:1.1.0' }

            – Miruna Radu
            Nov 13 '18 at 9:09













          • I have this fixed but do you have any idea to change the color of the ViewPagerIndicator ?

            – Spritzig
            Nov 13 '18 at 11:33






          • 1





            Try with : app:itemSelectedTint = "#color" and app:itemTint = "#anothercolor"

            – Miruna Radu
            Nov 13 '18 at 11:48






          • 1





            Your layout should contain this view : <com.github.vivchar.viewpagerindicator.ViewPagerIndicator android:id = "@+id/view_pager_indicator" android:layout_width = "wrap_content" android:layout_height = "wrap_content" app:itemSelectedTint = "@color/colorAccent" app:itemSize = "16dp" app:itemTint = "@color/colorPrimary" />

            – Miruna Radu
            Nov 13 '18 at 15:52














          1












          1








          1







          Gradle



          Step 1. Add the JitPack repository to your build file



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


          Step 2. Add the dependency



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


          I don't see these dependecies in your build.gradle file.Also,read again and follow the steps from the README file from the link you've shared.






          share|improve this answer













          Gradle



          Step 1. Add the JitPack repository to your build file



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


          Step 2. Add the dependency



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


          I don't see these dependecies in your build.gradle file.Also,read again and follow the steps from the README file from the link you've shared.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 '18 at 20:09









          Miruna RaduMiruna Radu

          465




          465













          • I am facing with problem Could not get unknown property 'LATEST_VERSION' for object of type org.gradle.api.internal.artifacts

            – Spritzig
            Nov 12 '18 at 21:19






          • 1





            Change LATEST_VERSION with 1.1.0. I mean , dependencies { implementation 'com.github.vivchar:ViewPagerIndicator:1.1.0' }

            – Miruna Radu
            Nov 13 '18 at 9:09













          • I have this fixed but do you have any idea to change the color of the ViewPagerIndicator ?

            – Spritzig
            Nov 13 '18 at 11:33






          • 1





            Try with : app:itemSelectedTint = "#color" and app:itemTint = "#anothercolor"

            – Miruna Radu
            Nov 13 '18 at 11:48






          • 1





            Your layout should contain this view : <com.github.vivchar.viewpagerindicator.ViewPagerIndicator android:id = "@+id/view_pager_indicator" android:layout_width = "wrap_content" android:layout_height = "wrap_content" app:itemSelectedTint = "@color/colorAccent" app:itemSize = "16dp" app:itemTint = "@color/colorPrimary" />

            – Miruna Radu
            Nov 13 '18 at 15:52



















          • I am facing with problem Could not get unknown property 'LATEST_VERSION' for object of type org.gradle.api.internal.artifacts

            – Spritzig
            Nov 12 '18 at 21:19






          • 1





            Change LATEST_VERSION with 1.1.0. I mean , dependencies { implementation 'com.github.vivchar:ViewPagerIndicator:1.1.0' }

            – Miruna Radu
            Nov 13 '18 at 9:09













          • I have this fixed but do you have any idea to change the color of the ViewPagerIndicator ?

            – Spritzig
            Nov 13 '18 at 11:33






          • 1





            Try with : app:itemSelectedTint = "#color" and app:itemTint = "#anothercolor"

            – Miruna Radu
            Nov 13 '18 at 11:48






          • 1





            Your layout should contain this view : <com.github.vivchar.viewpagerindicator.ViewPagerIndicator android:id = "@+id/view_pager_indicator" android:layout_width = "wrap_content" android:layout_height = "wrap_content" app:itemSelectedTint = "@color/colorAccent" app:itemSize = "16dp" app:itemTint = "@color/colorPrimary" />

            – Miruna Radu
            Nov 13 '18 at 15:52

















          I am facing with problem Could not get unknown property 'LATEST_VERSION' for object of type org.gradle.api.internal.artifacts

          – Spritzig
          Nov 12 '18 at 21:19





          I am facing with problem Could not get unknown property 'LATEST_VERSION' for object of type org.gradle.api.internal.artifacts

          – Spritzig
          Nov 12 '18 at 21:19




          1




          1





          Change LATEST_VERSION with 1.1.0. I mean , dependencies { implementation 'com.github.vivchar:ViewPagerIndicator:1.1.0' }

          – Miruna Radu
          Nov 13 '18 at 9:09







          Change LATEST_VERSION with 1.1.0. I mean , dependencies { implementation 'com.github.vivchar:ViewPagerIndicator:1.1.0' }

          – Miruna Radu
          Nov 13 '18 at 9:09















          I have this fixed but do you have any idea to change the color of the ViewPagerIndicator ?

          – Spritzig
          Nov 13 '18 at 11:33





          I have this fixed but do you have any idea to change the color of the ViewPagerIndicator ?

          – Spritzig
          Nov 13 '18 at 11:33




          1




          1





          Try with : app:itemSelectedTint = "#color" and app:itemTint = "#anothercolor"

          – Miruna Radu
          Nov 13 '18 at 11:48





          Try with : app:itemSelectedTint = "#color" and app:itemTint = "#anothercolor"

          – Miruna Radu
          Nov 13 '18 at 11:48




          1




          1





          Your layout should contain this view : <com.github.vivchar.viewpagerindicator.ViewPagerIndicator android:id = "@+id/view_pager_indicator" android:layout_width = "wrap_content" android:layout_height = "wrap_content" app:itemSelectedTint = "@color/colorAccent" app:itemSize = "16dp" app:itemTint = "@color/colorPrimary" />

          – Miruna Radu
          Nov 13 '18 at 15:52





          Your layout should contain this view : <com.github.vivchar.viewpagerindicator.ViewPagerIndicator android:id = "@+id/view_pager_indicator" android:layout_width = "wrap_content" android:layout_height = "wrap_content" app:itemSelectedTint = "@color/colorAccent" app:itemSize = "16dp" app:itemTint = "@color/colorPrimary" />

          – Miruna Radu
          Nov 13 '18 at 15:52


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269133%2fproject-android-fails-to-run-over-page-indicator-and-circlepageindicator%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Full-time equivalent

          さくらももこ

          13 indicted, 8 arrested in Calif. drug cartel investigation