Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    LassassinX
    @LassassinX
    but when i use the setNextPageSwipeLock(true), it doesnt work
    if i use the setSwipeLock(); it works, but it disables swiping both forwards and backwards which is not something i want
    using isPolicyRespected() does the same, but i can go back using the back button of the wizard mode or my phones back button(which can be disabled ik)
    The thing i want is that, the user cannot swipe or go to the next slide, but can visit the previous slide
    by swiping
    my code :
           @Override
               protected void onSlideChanged(Fragment oldFragment, Fragment newFragment) {
                   super.onSlideChanged(oldFragment, newFragment);
                   if (newFragment == loginSlide) {
                       changeIndicatorColor("Dark Blue");
                   }
    
                   if (newFragment == teacherOrStudentSlide) {
                       setNextPageSwipeLock(true);
                       changeIndicatorColor("White");
                   }
    
               }
    LassassinX
    @LassassinX
    My teacherOrStudentSlide class
        public class TeacherOrStudentSlide extends Fragment implements SlideBackgroundColorHolder ,                                                    SlidePolicy {
    
            private static final String ARG_COLOR_INT = "COLOR_INT";
            private int originalColor = 0;
            private ConstraintLayout background = null;
    
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        originalColor = getArguments().getInt(ARG_COLOR_INT);
    }
    
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.teacher_or_student_slide_layout, container, false);
    }
    
    @Override
    public void onViewCreated(@NonNull View view, @androidx.annotation.Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        background = view.findViewById(R.id.teacher_or_student_slide_constraint_layout);
    }
    
    public static TeacherOrStudentSlide newInstance(@ColorInt int originalColor) {
        TeacherOrStudentSlide newFragment = new TeacherOrStudentSlide();
        Bundle args = new Bundle();
        args.putInt(ARG_COLOR_INT, originalColor);
        newFragment.setArguments(args);
        return newFragment;
    }
    
    @Override
    public int getDefaultBackgroundColor() {
        return originalColor;
    }
    
    @Override
    public void setBackgroundColor(int backgroundColor) {
        background.setBackgroundColor(backgroundColor);
    }
    
    
    @Override
    public boolean isPolicyRespected() {
        return false;
    }
    
    @Override
    public void onUserIllegallyRequestedNextPage() {
        Toast.makeText(getContext(), "Please select if you are a Teacher or Student!", Toast.LENGTH_SHORT).show();
    }
    }
    if I use setSwipeLock(true); in the onSlideChanged method, it works but it disables swiping completely. setNextPageSwipeLock(true); doesnt seem to do anything
    maybe I called it in a wrong way ?
    Nicola Corti
    @cortinico
    Your TeacherOrStudentSlide should implements SlidePolicy otherwise your method isPolicyRespected and onUserIllegallyRequestedNextPage() won't be called.
    LassassinX
    @LassassinX
    no like i did implement them with slidePolicy and it works, however it locks swiping both forwards and backwards... I only wish to lock swiping forwards
    Let me upload a gif/video for better understanding
    Nicola Corti
    @cortinico

    however it locks swiping both forwards and backwards

    I've just tested it and I'm not able to reproduce

    LassassinX
    @LassassinX
    Hello, sorry for not giving all the information
    I have uploaded a video on youtube describing my problem in complete detail
    Please take a look
    Nicola Corti
    @cortinico

    Hi @LassassinX I've checked your video, and I'm still unable to reproduce. I see your problem but I assume is a misconfiguration of your SlidePolicy.

    If possible, please share the code.

    I'm also adding a sample of SlidePolicy to the sample app: AppIntro/AppIntro#847

    If you see the image here: https://user-images.githubusercontent.com/3001957/90595957-3e2faf80-e1ee-11ea-8ffc-8ce3702d35d7.gif
    This clearly allows only back swiping.

    LassassinX
    @LassassinX
    Hello @cortinico
    Can you please give an example in java?
    This is the only issue left with appIntro for me, after this my app will be up and running on the play store :D
    I am sharing the code
    Please pull it and let me know what I'm doing wrong
    also are we getting a setBackArrowColor() method soon ? :D
    Nicola Corti
    @cortinico

    To answer your questions @LassassinX. Both your features are available on the latest master. But not on AppIntro 6.0.0. I will make a release in the near future.

    You can use the latest master in your project if you depend on:
    implementation 'com.github.AppIntro:AppIntro:master-SNAPSHOT'

    Specifically:
    • setBackArrowColor() was added by this PR: #825
    • The backward swiping was added by this PR: #817
    Here an image of how your app behaves using the latest master https://imgur.com/a/EpbQnop
    LassassinX
    @LassassinX
    @cortinico thankyou! It works perfectly!
    LassassinX
    @LassassinX
    Hello @cortinico ! I recently downloaded one of your libraries known as SlideToAct. My question is, I have an animated vector drawable which is a refresh icon that rotates. I made it using ShapeShifter.desgin . How can I set it as a completed icon and make it loop ? Also, when I click a button, the completed icon will change from the refresh rotation animation to a done tick animation. An example in java would be amazing! TIA
       protected void onCreate(@Nullable Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.animation_test_layout);
    
    
              slideToActView = findViewById(R.id.slider_button_new);
              slideToActView.setCompleteIcon(R.drawable.test_rotate_anim);
    
    
      }
    
    
           public void stopAnimation(View view) {
               slideToActView.setCompleteIcon(R.drawable.done_tick_anim);
           }
    using this code, the rotate animation drawable only rotates once, and the stopAnimation is a button onClick method. When its called, it doesn't start the done tick animation
    Nicola Corti
    @cortinico

    Hey @LassassinX

    Hello @cortinico ! I recently downloaded one of your libraries known as SlideToAct

    This channel is reserved for AppIntro support. Please open an issue on SlideToAct issue tracker if you have a question on that front.

    LassassinX
    @LassassinX
    I am getting unwanted behavior when using a custom layout with buttons alongside SlidePolicy
    LassassinX
    @LassassinX
    My slides have 2 buttons, which if pressed goes to the next slide. The slide implements SlidePolicy, so it prevents swiping. On IllegallyRequestNextSlide(), I have made a dialog box telling the user to press any one of the buttons. However, there is some unwanted behaviour. Sometimes when the user presses the button, goToNextSlide() is called along with IllegallyRequestNextSlide(). Sometimes it calls IllegallyRequestNextSlide(). This is pretty ground breaking for my app. I uploaded a video showing this issue in action, please take a look.
    is the problem with my code ?
    //ButtonOnClickListener
                public void select(View view) {
                        if(view.getId()==R.id.btn_teacher_or_student_t){
                               flag = "teacher";
                         }else{
                              flag = "student";
                         }
                  teacherOrStudentSlide.isPolicyRespected();
                  goToNextSlide(false);
               }
    here calling teacherOrStudentSlide.isPolicyRespected(); doesn't really make a difference at all
    my teacherOrStudentSlide
     @Override
      public boolean isPolicyRespected() {
             return false;
         }
    
     @Override
         public void onUserIllegallyRequestedNextPage() {
                  CommonMethods.simpleOkDialog(getActivity(),"Please Select an option","");
         }
    LassassinX
    @LassassinX
    I am using version master-SNAPSHOT
    Here is the video explaining this behavior, please take a look. TIA
    Nicola Corti
    @cortinico
    @LassassinX This seems like a bug. Can I ask you to file an issue on the issue tracker with your code and a link to the video? Thanks :+1:
    LassassinX
    @LassassinX
    Ofcourse!
    LassassinX
    @LassassinX
    @cortinico Done
    AppIntro/AppIntro#860
    Nicola Corti
    @cortinico

    @/all We are slowly sunsetting this Gitter chat in favor of KotlinLang Slack (channel #appintro).

    More details on this PR: AppIntro/AppIntro#861
    In the long run, active support for AppIntro will be offered only there.