Commit e992b150 authored by Gilbert Ndresaj's avatar Gilbert Ndresaj 💬

App Intro Implemented

Fist Start App Intro Implemented!!
parent b3e56ee6
......@@ -13,6 +13,7 @@ repositories {
maven {
url "http://dl.bintray.com/dasar/maven"
}
mavenCentral()
}
android {
......@@ -40,6 +41,7 @@ android {
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:cardview-v7:+'
......@@ -65,4 +67,5 @@ dependencies {
transitive = true
}
compile(group: 'uz.shift', name: 'colorpicker', version: '0.5', ext: 'aar')
compile 'com.github.paolorotolo:appintro:+'
}
......@@ -11,6 +11,11 @@
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity android:name=".IntroActivity"
android:label="Intro Activity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
/>
<activity android:name=".SettingsActivity"
android:label="Setting"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
......
......@@ -13,13 +13,18 @@ import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.*;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.leafpic.app.Adapters.AlbumsAdapter;
......@@ -37,19 +42,19 @@ import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
public class AlbumsActivity extends AppCompatActivity {
HandlingAlbums albums = new HandlingAlbums(AlbumsActivity.this);
boolean editmode = false, hidden = false;
RecyclerView mRecyclerView;
AlbumsAdapter adapt;
Toolbar toolbar;
SharedPreferences SP;
MadiaStoreHandler asd = new MadiaStoreHandler(AlbumsActivity.this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -57,6 +62,27 @@ public class AlbumsActivity extends AppCompatActivity {
SP = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
initUiTweaks();
checkPermissions();
//APP INTRO STATS HEARE DIO CANE
Thread t = new Thread(new Runnable() {
@Override
public void run() {
SharedPreferences getPrefs = PreferenceManager
.getDefaultSharedPreferences(getBaseContext());
boolean isFirstStart = getPrefs.getBoolean("firstStart", true);
if (isFirstStart) {
Intent i = new Intent(AlbumsActivity.this, IntroActivity.class);
startActivity(i);
SharedPreferences.Editor e = getPrefs.edit();
e.putBoolean("firstStart", false);
e.apply();
}
}
});
t.start();
//asd.LogStuff();
//asd.loadPhotos();
//asd.logPhotos();
......
package com.leafpic.app;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.Toast;
import com.github.paolorotolo.appintro.AppIntro;
import com.github.paolorotolo.appintro.AppIntroFragment;
/**
* Created by Jibo on 29/01/2016.
*/
public class IntroActivity extends AppIntro {
int slide=1;
@Override
public void init(Bundle savedInstanceState) {
addSlide(AppIntroFragment.newInstance("LeafPic", "The Faster Gallery for Your Android :)",
R.mipmap.ic_launcher, Color.parseColor("#009688")));
addSlide(AppIntroFragment.newInstance("Leaf Pic", Html.fromHtml("<b>DONY GHEEEY </b><br><i>la descrizione itallica spifina!!!</i>"),
R.mipmap.ic_launcher, Color.parseColor("#607D8B")));
setBarColor(Color.parseColor("#00796B"));
setSeparatorColor(Color.parseColor("#009688"));
showSkipButton(true);
}
private void loadMainActivity() {
Intent intent = new Intent(this, AlbumsActivity.class);
startActivity(intent);
}
@Override
public void onSkipPressed() {
loadMainActivity();
Toast.makeText(getApplicationContext(), getString(R.string.skip), Toast.LENGTH_SHORT).show();
}
@Override
public void onNextPressed() {
}
@Override
public void onDonePressed() {
loadMainActivity();
}
@Override
public void onSlideChanged() {
if (slide==1) {
slide=2;
setSeparatorColor(Color.parseColor("#00796B"));
setBarColor(Color.parseColor("#00796B"));
} else{
slide=1;
setSeparatorColor(Color.parseColor("#607D8B"));
setBarColor(Color.parseColor("#455A64"));
}
}
public void getStarted(View v) {
loadMainActivity();
}
}
\ No newline at end of file
......@@ -33,4 +33,5 @@
<string name="primaryColor">Primary Color</string>
<string name="color_palette">Color Palette</string>
<string name="skip">Why You Skip This Beautyfull Intro? Maledetto!!!</string>
</resources>
......@@ -37,4 +37,11 @@
<item name="rippleColor">@android:color/white</item>
</style>
<style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment