-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b72b6f6
commit e2b999e
Showing
61 changed files
with
1,615 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
/build |
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,31 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.2" | ||
defaultConfig { | ||
applicationId "walkthrough.a2doapp.com.walkthrough" | ||
minSdkVersion 21 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
compile 'com.android.support:appcompat-v7:25.2.0' | ||
|
||
// Circular View Pager Indicator | ||
compile 'me.relex:circleindicator:1.2.2@aar' | ||
} |
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,25 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Android/android-sdk-mac_x86/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
Binary file not shown.
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,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="walkthrough.a2doapp.com.walkthrough"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".WalkthroughActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
58 changes: 58 additions & 0 deletions
58
app/src/main/java/walkthrough/a2doapp/com/walkthrough/ScaleImageView.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,58 @@ | ||
package walkthrough.a2doapp.com.walkthrough; | ||
|
||
import android.content.Context; | ||
import android.graphics.drawable.Drawable; | ||
import android.support.v7.widget.AppCompatImageView; | ||
import android.util.AttributeSet; | ||
|
||
/** | ||
* Created by fahad on 22/09/2016. | ||
*/ | ||
|
||
|
||
/** | ||
* ImageView that keeps aspect ratio when scaled | ||
*/ | ||
public class ScaleImageView extends AppCompatImageView { | ||
|
||
public ScaleImageView(Context context) { | ||
super(context); | ||
} | ||
|
||
public ScaleImageView(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public ScaleImageView(Context context, AttributeSet attrs, int defStyle) { | ||
super(context, attrs, defStyle); | ||
} | ||
|
||
@Override | ||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | ||
try { | ||
Drawable drawable = getDrawable(); | ||
if (drawable == null) { | ||
setMeasuredDimension(0, 0); | ||
} else { | ||
int measuredWidth = MeasureSpec.getSize(widthMeasureSpec); | ||
int measuredHeight = MeasureSpec.getSize(heightMeasureSpec); | ||
if (measuredHeight == 0 && measuredWidth == 0) { //Height and width set to wrap_content | ||
setMeasuredDimension(measuredWidth, measuredHeight); | ||
} else if (measuredHeight == 0) { //Height set to wrap_content | ||
int width = measuredWidth; | ||
int height = width * drawable.getIntrinsicHeight() / drawable.getIntrinsicWidth(); | ||
setMeasuredDimension(width, height); | ||
} else if (measuredWidth == 0) { //Width set to wrap_content | ||
int height = measuredHeight; | ||
int width = height * drawable.getIntrinsicWidth() / drawable.getIntrinsicHeight(); | ||
setMeasuredDimension(width, height); | ||
} else { //Width and height are explicitly set (either to match_parent or to exact value) | ||
setMeasuredDimension(measuredWidth, measuredHeight); | ||
} | ||
} | ||
} catch (Exception e) { | ||
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | ||
} | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/walkthrough/a2doapp/com/walkthrough/WalkthroughActivity.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,20 @@ | ||
package walkthrough.a2doapp.com.walkthrough; | ||
|
||
import android.support.v4.app.Fragment; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
|
||
public class WalkthroughActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
Fragment fragment = getSupportFragmentManager().findFragmentByTag("walkthroughFragment"); | ||
if (fragment == null) { | ||
getSupportFragmentManager().beginTransaction() | ||
.replace(android.R.id.content, new WalkthroughActivityFragment(), "walkthroughFragment") | ||
.commit(); | ||
} | ||
} | ||
} |
Oops, something went wrong.