Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aniket #9

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ google-services.json

### Android Patch ###
gen-external-apklibs

.idea
50 changes: 50 additions & 0 deletions Assignment1&2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
### Android ###
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/

# Keystore files
*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

### Android Patch ###
gen-external-apklibs
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions Assignment1&2/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.sdsmdg.hareshkh.lectureassignment"
minSdkVersion 19
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:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.sdsmdg.tastytoast:tastytoast:0.1.0'
testCompile 'junit:junit:4.12'
}
File renamed without changes.
21 changes: 21 additions & 0 deletions Assignment1&2/app/src/main/AndroidManifest.xml
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="com.sdsmdg.hareshkh.lectureassignment">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".aniket.SeekBarActivity" />
<activity android:name=".aniket.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added Assignment1&2/app/src/main/assets/OCRAEXT.TTF
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package com.sdsmdg.hareshkh.lectureassignment.aniket;

import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.sdsmdg.hareshkh.lectureassignment.R;
import com.sdsmdg.tastytoast.TastyToast;

import java.util.ArrayList;

/**
* Created by DELL on 01-02-2017.
*/

public class ArrayAdapter extends RecyclerView.Adapter<ArrayAdapter.MyViewHolder> {
public Context context;

public ArrayList<MovieItems> movies;

public ArrayAdapter(ArrayList<MovieItems> movies) {
this.movies = movies;
}

@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.movie_item, parent, false);

return new MyViewHolder(itemView);
}

@Override
public void onBindViewHolder(MyViewHolder holder, final int position) {

holder.movie.setText(movies.get(position).getMoviename());
holder.year.setText(movies.get(position).getMovieyear());
holder.img.setImageResource(movies.get(position).getImageid());
holder.cd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
TastyToast.makeText(context, movies.get(position).getMoviename(),
Toast.LENGTH_SHORT, TastyToast.SUCCESS);

}
});


}

@Override
public int getItemCount() {
return movies.size();
}

public class MyViewHolder extends RecyclerView.ViewHolder

{
public TextView movie;
public TextView year;
public ImageView img;
public CardView cd;

public MyViewHolder(View view) {
super(view);
context = view.getContext();
img = (ImageView) view.findViewById(R.id.im);
movie = (TextView) view.findViewById(R.id.t1);
year = (TextView) view.findViewById(R.id.t2);
cd = (CardView) view.findViewById(R.id.c1);

}


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.sdsmdg.hareshkh.lectureassignment.aniket;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.ProgressBar;

/**
* Created by DELL on 01-03-2017.
*/

public class CustomProgressBar extends ProgressBar {


public CustomProgressBar(Context context) {
super(context);
}

public CustomProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
}

public CustomProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

public CustomProgressBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}

@Override
protected synchronized void onDraw(Canvas canvas) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.sdsmdg.hareshkh.lectureassignment.aniket;

import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.SeekBar;

/**
* Created by DELL on 25-02-2017.
*/

public class LayoutBehaviour extends CoordinatorLayout.Behavior<RelativeLayout> {
public LayoutBehaviour() {
super();
}

public LayoutBehaviour(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}

@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, RelativeLayout child, View dependency) {
float translationY = Math.min(0, ViewCompat.getTranslationY(dependency) - dependency.getHeight());
ViewCompat.setTranslationY(child, translationY);
return true;
}

@Override
public void onDependentViewRemoved(CoordinatorLayout parent, RelativeLayout child, View dependency) {
ViewCompat.animate(child).translationY(0).start();
}

@Override
public boolean layoutDependsOn(CoordinatorLayout parent, RelativeLayout child, View dependency) {
return dependency instanceof Snackbar.SnackbarLayout;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.sdsmdg.hareshkh.lectureassignment.aniket;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;

import com.sdsmdg.hareshkh.lectureassignment.R;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

ArrayList<MovieItems> mov = new ArrayList<>();
mov.add(new MovieItems("Resident Evil Final Chapter", "Feb 3 2017", R.drawable.m1));
mov.add(new MovieItems("Assassin's Creed", "Dec 30 2016", R.drawable.asscreed));
mov.add(new MovieItems("Bye Bye Man", "Jan 20 2017", R.drawable.byebyeman));
mov.add(new MovieItems("Moana", "Dec 2 2016", R.drawable.moana));
mov.add(new MovieItems("Passengers", "Jan 6 2017", R.drawable.passengers));
mov.add(new MovieItems("The Great Wall", "Feb 3 2017", R.drawable.thegreatwall));
mov.add(new MovieItems("XXX : The Return of Xander Cage", "Jan 14 2017", R.drawable.xxxretofxandercage));
mov.add(new MovieItems("Arrival", "Feb 3 2017", R.drawable.arrival));
ArrayAdapter adapter = new ArrayAdapter(mov);
RecyclerView recylView = (RecyclerView) findViewById(R.id.recyl);
LinearLayoutManager horizontalLayoutManagaer
= new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
recylView.setLayoutManager(horizontalLayoutManagaer);
recylView.setAdapter(adapter);
Button asgn = (Button) findViewById(R.id.asgn2);
asgn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(MainActivity.this, SeekBarActivity.class);
startActivity(i);

}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.sdsmdg.hareshkh.lectureassignment.aniket;

/**
* Created by DELL on 01-02-2017.
*/

public class MovieItems {
public String moviename;
public String movieyear;
public int imageid;

public MovieItems(String moviename, String movieyear, int imageid) {
this.moviename = moviename;
this.movieyear = movieyear;
this.imageid = imageid;


}

public String getMoviename() {
return moviename;
}

public void setMoviename(String moviename) {
this.moviename = moviename;
}

public String getMovieyear() {
return movieyear;
}

public void setMovieyear(String movieyear) {
this.movieyear = movieyear;
}

public int getImageid() {
return imageid;
}

public void setImageid(int imageid) {
this.imageid = imageid;
}
}
Loading