Comments (10)
Can you record a vido of your screen?
from material-intro.
https://www.dropbox.com/s/pjvsrpygexvfpi0/SCR_20160428_082421.mp4?dl=0
I implemetd this the same way as it is done in the example app, however the issue is that the app closes in my case
from material-intro.
So you used the gradle dependency and I guess SimpleSlide
?
And the example App works?
from material-intro.
Fragment lifecycle is tricky especially when used in a ViewPager
. Did you override anything lifecycle related in your activity?
You can also try the new version 1.4.
from material-intro.
Sorry i do not believe i fully understand? I am not all that knowledgeable with java. My drawer activity is my splash screen, which checks a preference for if it is the first time the app is starting. If so, then it is set to execute the activity which extends the IntroActivity and implements the SimpleSlide. I can attach some code if necesary. My app is based off an open-source dashboard, called Polar if this is of any use to you. :-)
from material-intro.
That would be useful!
from material-intro.
Splash Screen:
`package com.afollestad.polar.ui.base;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import com.afollestad.polar.R;
import com.afollestad.polar.ui.MainActivity;
import com.afollestad.polar.ui.WelcomeActivity;
/**
-
Created by Ethan on 14/04/2016.
*/
public class SplashScreen extends Activity {public static final String PREFS_NAME = "MatWallsPref"; // Name of prefs file; don't change this after it's saved something
@OverRide
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);Thread timerThread = new Thread(){ public void run(){ try{ sleep(700); }catch(InterruptedException e){ e.printStackTrace(); }finally{ SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); // Get preferences file (0 = no option flags set) boolean firstRun = settings.getBoolean("firstRun", true); // Is it first run? If not specified, use "true" if (firstRun) { Log.w("activity", "first time"); SharedPreferences.Editor editor = settings.edit(); // Open the editor for our settings editor.putBoolean("firstRun", false); // It is no longer the first run editor.commit(); // Save all changed settings Intent intent = new Intent(SplashScreen.this, WelcomeActivity.class); startActivity(intent); } else { Log.w("activity", "second time"); Intent intent = new Intent(SplashScreen.this,MainActivity.class); startActivity(intent); } } } }; timerThread.start();
}
@OverRide
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
finish();
}
}
Welcome Activity:
package com.afollestad.polar.ui;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import com.afollestad.polar.R;
import com.heinrichreimersoftware.materialintro.app.IntroActivity;
import com.heinrichreimersoftware.materialintro.app.NavigationPolicy;
import com.heinrichreimersoftware.materialintro.app.OnNavigationBlockedListener;
import com.heinrichreimersoftware.materialintro.slide.SimpleSlide;
/**
-
Created by Ethan on 14/04/2016.
*/
public class WelcomeActivity extends IntroActivity {@OverRide
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
setFullscreen(true);
super.onCreate(savedInstanceState);
/* Enable/disable skip button */
setSkipEnabled(true);/* Enable/disable finish button */ setFinishEnabled(true); addSlide(new SimpleSlide.Builder() .title(R.string.app_name) .description(R.string.homepage_description) .image(R.drawable.ic_web2) .background(R.color.theme_default_primary) .backgroundDark(R.color.theme_default_primary_dark) .build()); addSlide(new SimpleSlide.Builder() .title(R.string.app_name) .description(R.string.homepage_description) .image(R.drawable.ic_web2) .background(R.color.accent_2_dark) .backgroundDark(R.color.accent_1_dark) .build()); /* Add a navigation policy to define when users can go forward/backward */
}
@OverRide
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
finish();
}
}
`
from material-intro.
Sorry its not formatted correctly.
from material-intro.
Hey there never mind. The issue seems to be resolved! It was an issue on my end, where I was calling the intro from the splash screen, and the splash screen would close. So when you rotated it there was no activity holding the intro I believe.
Anyway I've added your awesome into into my app! Feel free to check it out! https://play.google.com/store/apps/details?id=com.erc.software.materialwallpapers
Thank you very much for your assistance and sorry for the inconvenience.
from material-intro.
Yep, that's the issue here. You should start the intro in your MainActivity.java. I should add a demo for implementing the intro with a splash screen
from material-intro.
Related Issues (20)
- Button doesn't adjust its size depending on length of text
- Glitch when moving from slide without button to slide with button
- NullPointerException
- Could not find com.heinrichreimersoftware:material-intro:x.y.z. HOT 1
- Could not find com.heinrichreimersoftware:material-intro:x.y.z. HOT 1
- Freeze when switching Activity HOT 8
- Slider cannot open screens HOT 2
- A slide can be skipped even if navigation is blocked HOT 1
- Null object reference on customization setButtonBackVisible(true);
- Crashes due resource not found exception below API 23
- Mention that "Databinding = true" is necessary for using custom slides(fragmentslide)
- Crash due to NPE
- Continuous Lagging when swiping
- java.lang.ClassNotFoundException
- RTL support
- Glitch when moving from slide without button to slide with button
- Lag when swipe
- java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity
- Rotation HOT 1
- Resource Not Found: mi_ic_skip, mi_ic_previous, mi_ic_next, mi_ic_finish
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-intro.