Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not slide one fragment to another #14

Open
Realwishall opened this issue Dec 28, 2019 · 1 comment
Open

can not slide one fragment to another #14

Realwishall opened this issue Dec 28, 2019 · 1 comment

Comments

@Realwishall
Copy link

I am very new to android development only made small project which i need to work for my physics classes

i am facing isshu that is.
i am stuck on first fragment and can not go to any other page and on this page only cancel button is working...
this is my code

package com.example.demoreel;

import androidx.appcompat.app.AppCompatActivity;

import android.Manifest;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.Toast;

import com.hololo.tutorial.library.PermissionStep;
import com.hololo.tutorial.library.Step;
import com.hololo.tutorial.library.TutorialActivity;

public class MyTuorialSlider extends TutorialActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
   // setContentView(R.layout.activity_my_tuorial_slider);
    addFragment(
            new PermissionStep
                    .Builder()
                    .setPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE})
                    .setTitle(getString(R.string.permission_title)).setContent(getString(R.string.permission_detail))
                    .setBackgroundColor(Color.parseColor("#FF0957"))
                    .setDrawable(R.drawable.ss_1)
                    .setSummary(getString(R.string.continue_and_learn))
                    .build());
    addFragment(
            new Step.Builder()
                    .setTitle(getString(R.string.automatic_data))
                    .setContent(getString(R.string.gm_finds_photos))
                    .setBackgroundColor(Color.parseColor("#FF0957"))
                    .setDrawable(R.drawable.ss_1)
                    .setSummary(getString(R.string.continue_and_learn))
                    .build());
    addFragment(
            new Step.Builder()
                    .setTitle(getString(R.string.choose_the_song))
                    .setContent(getString(R.string.swap_to_the_tab))
                    .setBackgroundColor(Color.parseColor("#00D4BA"))
                    .setDrawable(R.drawable.ss_2)
                    .setSummary(getString(R.string.continue_and_update))
                    .build());
    addFragment(
            new Step.Builder()
                    .setTitle(getString(R.string.edit_data))
                    .setContent(getString(R.string.update_easily))
                    .setBackgroundColor(Color.parseColor("#1098FE"))
                    .setDrawable(R.drawable.ss_2)
                    .setSummary(getString(R.string.continue_and_result))
                    .build());
    addFragment(
            new Step.Builder()
                    .setTitle(getString(R.string.result_awesome))
                    .setContent(getString(R.string.after_updating))
                    .setBackgroundColor(Color.parseColor("#CA70F3"))
                    .setDrawable(R.drawable.ss_1)
                    .setSummary(getString(R.string.thank_you))
                    .build());
    setPrevText("LAST"); // Previous button text
    setNextText("NEXT"); // Next button text
    setFinishText("ENTER"); // Finish button text
   // setCancelText("Heelo cance"); // Cancel button text
    //setIndicatorSelected(int drawable); // Indicator drawable when selected
    //setIndicator(int drawable); // Indicator drawable
    setGivePermissionText("DONE"); // Permission button text
    Toast.makeText(getApplicationContext(),"Play",Toast.LENGTH_LONG).show();
}

@Override
public void finishTutorial() {
    Toast.makeText(this, "Tutorial finished", Toast.LENGTH_SHORT).show();
    finish();
}

@Override
public void currentFragmentPosition(int position) {
    Toast.makeText(this, "Position : " + position, Toast.LENGTH_SHORT).show();
}

}

@syash5
Copy link

syash5 commented Jul 9, 2020

Remove the first addfragment from your code, the one with PermissionStep.Builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants