Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ dependencies {
compile 'com.android.support:support-v4:23.4.0'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'

compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.cleveroad:splittransformation:0.9.0'
}
16 changes: 12 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.manis.myapp">
<uses-permission android:name="android.permission.INTERNET"/>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand All @@ -16,14 +18,20 @@
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Developer" /><!-- ATTENTION: This was auto-generated to add Google Play services to your project for
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information. -->
<activity android:name=".Developer" />
<!--
ATTENTION: This was auto-generated to add Google Play services to your project for
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information.
-->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<activity android:name=".Gallery"></activity>
</application>

</manifest>
55 changes: 55 additions & 0 deletions app/src/main/java/com/example/manis/myapp/AndroidImageAdapter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.example.manis.myapp;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

/**
* Created by manis on 24-Jun-17.
*/
public class AndroidImageAdapter extends PagerAdapter {
Context mContext;

AndroidImageAdapter(Context context) {
this.mContext = context;
}

@Override
public int getCount() {
return sliderImagesId.length;
}

private String[] sliderImagesId = new String[]{
"http://images.all-free-download.com/images/graphiclarge/mississippi_landscape_scenic_214567.jpg",
"https://s-media-cache-ak0.pinimg.com/originals/57/80/0e/57800e6fd63b49c51c106bc26bbc3933.jpg",
"https://s-media-cache-ak0.pinimg.com/736x/9e/9a/84/9e9a847b036b582a20fb4ae76c444fb3--green-scenery-black-garden.jpg"

};

@Override
public boolean isViewFromObject(View v, Object obj) {
return v == ((ImageView) obj);
}

@Override
public Object instantiateItem(ViewGroup container, int i) {
ImageView mImageView = new ImageView(mContext);
mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
// mImageView.setImageResource(sliderImagesId[i]);


Picasso.with(mContext).load(sliderImagesId[i]).into(mImageView);
((ViewPager) container).addView(mImageView, 0);
return mImageView;
}

@Override
public void destroyItem(ViewGroup container, int i, Object obj) {
((ViewPager) container).removeView((ImageView) obj);
}
}
18 changes: 18 additions & 0 deletions app/src/main/java/com/example/manis/myapp/Gallery.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.example.manis.myapp;

import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class Gallery extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gallery2);
getSupportActionBar().setTitle("Gallery");
ViewPager mViewPager = (ViewPager) findViewById(R.id.viewPageAndroid);
AndroidImageAdapter adapterView = new AndroidImageAdapter(this);
mViewPager.setAdapter(adapterView);
}
}
2 changes: 2 additions & 0 deletions app/src/main/java/com/example/manis/myapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ private void displaySelectedScreen(int id) {
} else if (id == R.id.nav_web) {

} else if (id == R.id.nav_photo) {
Intent i = new Intent(MainActivity.this, Gallery.class);
startActivity(i);

} else if (id == R.id.nav_results) {

Expand Down
Empty file.
Binary file added app/src/main/res/drawable-v21/cat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
Binary file added app/src/main/res/drawable-v21/image1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-v21/image2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions app/src/main/res/layout/activity_gallery2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.manis.myapp.Gallery">
<android.support.v4.view.ViewPager
android:id="@+id/viewPageAndroid"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout>