-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated the Introduction activity in the app.
- Loading branch information
Showing
10 changed files
with
235 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/org/amahi/anywhere/activity/IntroductionActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (c) 2014 Amahi | ||
* | ||
* This file is part of Amahi. | ||
* | ||
* Amahi is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Amahi is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Amahi. If not, see <http ://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.amahi.anywhere.activity; | ||
|
||
import android.content.Intent; | ||
import android.graphics.Color; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v4.app.Fragment; | ||
import android.support.v4.content.ContextCompat; | ||
|
||
import com.github.paolorotolo.appintro.AppIntro; | ||
import com.github.paolorotolo.appintro.AppIntroFragment; | ||
|
||
import org.amahi.anywhere.R; | ||
import org.amahi.anywhere.util.SampleSlide; | ||
|
||
public class IntroductionActivity extends AppIntro { | ||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
addSlide(SampleSlide.newInstance(R.layout.intro_first_layout)); | ||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_2), getString(R.string.intro_desc_phone_2), R.drawable.network, ContextCompat.getColor(this, R.color.intro_2))); | ||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_3), getString(R.string.intro_desc_phone_3), R.drawable.photos, Color.DKGRAY)); | ||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_4), getString(R.string.intro_desc_phone_4), R.drawable.music, ContextCompat.getColor(this, R.color.intro_4))); | ||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_5), getString(R.string.intro_desc_phone_5), R.drawable.movies, ContextCompat.getColor(this, R.color.intro_5))); | ||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_6), getString(R.string.intro_desc_6), R.drawable.tick, ContextCompat.getColor(this, R.color.intro_6))); | ||
setFlowAnimation(); | ||
} | ||
|
||
@Override | ||
public void onDonePressed(Fragment currentFragment) { | ||
super.onDonePressed(currentFragment); | ||
launchTv(); | ||
} | ||
|
||
@Override | ||
public void onSkipPressed(Fragment currentFragment) { | ||
super.onSkipPressed(currentFragment); | ||
launchTv(); | ||
} | ||
|
||
private void launchTv() { | ||
startActivity(new Intent(this, NavigationActivity.class)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/org/amahi/anywhere/util/RecyclerItemClickListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright (c) 2014 Amahi | ||
* | ||
* This file is part of Amahi. | ||
* | ||
* Amahi is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Amahi is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Amahi. If not, see <http ://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.amahi.anywhere.util; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.ColorInt; | ||
import android.support.annotation.Nullable; | ||
import android.support.v4.app.Fragment; | ||
import android.support.v4.content.ContextCompat; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import com.github.paolorotolo.appintro.ISlideBackgroundColorHolder; | ||
|
||
import org.amahi.anywhere.R; | ||
|
||
public class SampleSlide extends Fragment implements ISlideBackgroundColorHolder { | ||
|
||
private static final String ARG_LAYOUT_RES_ID = "layoutResId"; | ||
ViewGroup mContainer; | ||
private int layoutResId; | ||
|
||
public static SampleSlide newInstance(int layoutResId) { | ||
SampleSlide sampleSlide = new SampleSlide(); | ||
|
||
Bundle args = new Bundle(); | ||
args.putInt(ARG_LAYOUT_RES_ID, layoutResId); | ||
sampleSlide.setArguments(args); | ||
|
||
return sampleSlide; | ||
} | ||
|
||
@Override | ||
public void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
if (getArguments() != null && getArguments().containsKey(ARG_LAYOUT_RES_ID)) { | ||
layoutResId = getArguments().getInt(ARG_LAYOUT_RES_ID); | ||
} | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, | ||
@Nullable Bundle savedInstanceState) { | ||
mContainer = container; | ||
return inflater.inflate(layoutResId, container, false); | ||
} | ||
|
||
@Override | ||
public int getDefaultBackgroundColor() { | ||
return ContextCompat.getColor(getContext(), R.color.intro_1); | ||
} | ||
|
||
@Override | ||
public void setBackgroundColor(@ColorInt int i) { | ||
if (mContainer != null) | ||
mContainer.setBackgroundColor(i); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<ImageView | ||
android:id="@+id/imageView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="90dp" | ||
app:srcCompat="@drawable/ic_banner" | ||
android:layout_alignParentTop="true" | ||
android:layout_centerHorizontal="true" /> | ||
|
||
<android.support.v7.widget.CardView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@+id/imageView" | ||
android:layout_centerHorizontal="true" | ||
android:layout_marginTop="60dp" | ||
android:layout_marginStart="40dp" | ||
android:layout_marginEnd="40dp"> | ||
<RelativeLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
<TextView | ||
android:padding="16dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/text_title" | ||
android:gravity="center" | ||
android:textSize="20sp" | ||
android:textColor="@android:color/white" | ||
android:text="@string/intro_phone_1"/> | ||
|
||
<TextView | ||
android:layout_below="@id/text_title" | ||
android:padding="16dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textSize="15sp" | ||
android:text="@string/intro_desc_phone_1"/> | ||
</RelativeLayout> | ||
</android.support.v7.widget.CardView> | ||
|
||
|
||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters