├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── CardListGridView.iml ├── README.md ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── hopend │ │ └── saravana │ │ └── cardlistgridview │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── hopend │ │ └── saravana │ │ └── cardlistgridview │ │ ├── GridFragment.java │ │ ├── ListFragment.java │ │ ├── MainActivity.java │ │ ├── ObjectGridAdapter.java │ │ ├── ObjectHolder.java │ │ ├── ObjectListAdapter.java │ │ ├── RecyclerViewMaterialAdapter.java │ │ ├── TaskTypePagerAdapter.java │ │ ├── TestRecyclerViewAdapter.java │ │ └── objectbean.java │ └── res │ ├── drawable-hdpi │ ├── ic_launcher.png │ └── plus.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ ├── activity_main.xml │ ├── fragment_eads.xml │ ├── fragment_recyclerview.xml │ ├── grid_item_card_small.xml │ ├── list_item_card_big.xml │ └── list_item_card_small.xml │ ├── menu │ └── menu_main.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── color.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | CardListGridView -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Android API 21 Platform 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CardListGridView.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CardListGridView 2 | Material ListView and GridView using recycler view and card view 3 | ![alt tag](https://cloud.githubusercontent.com/assets/10529814/8391018/96e2ff38-1ccd-11e5-82bd-3bb8a9030d62.jpg) 4 | 5 | 6 | ![alt tag](https://cloud.githubusercontent.com/assets/10529814/8391014/96bc7958-1ccd-11e5-8785-a4fc71f07b58.jpg) 7 | 8 | 9 | ![alt tag](https://cloud.githubusercontent.com/assets/10529814/8391016/96c1e3d4-1ccd-11e5-97c0-4eb39cc08bc1.jpg) 10 | 11 | 12 | ![alt tag](https://cloud.githubusercontent.com/assets/10529814/8391017/96c44714-1ccd-11e5-8e39-79d5e0a56127.jpg) 13 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "com.hopend.saravana.cardlistgridview" 9 | minSdkVersion 15 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies 23 | { 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | compile 'com.android.support:appcompat-v7:22.2.0' 26 | compile 'com.android.support:support-v4:22.2.0' 27 | compile 'com.android.support:cardview-v7:22.2.0' 28 | compile 'com.android.support:support-annotations:22.2.0' 29 | compile 'com.getbase:floatingactionbutton:1.9.0' 30 | compile 'it.neokree:MaterialTabs:0.11' 31 | compile 'com.android.support:recyclerview-v7:22.2.0' 32 | } 33 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\android-sdk-windows/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/hopend/saravana/cardlistgridview/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/GridFragment.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.net.Uri; 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v7.widget.GridLayoutManager; 7 | import android.support.v7.widget.LinearLayoutManager; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | 13 | import java.util.ArrayList; 14 | 15 | 16 | public class GridFragment extends Fragment { 17 | 18 | 19 | 20 | private RecyclerView mRecyclerView; 21 | private RecyclerView.Adapter mAdapter; 22 | ArrayList cards = new ArrayList<>(); 23 | 24 | public GridFragment() { 25 | // Required empty public constructor 26 | } 27 | 28 | @Override 29 | public void onCreate(Bundle savedInstanceState) 30 | { 31 | super.onCreate(savedInstanceState); 32 | 33 | } 34 | 35 | @Override 36 | public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) 37 | { 38 | View view = inflater.inflate(R.layout.fragment_recyclerview, container, false); 39 | 40 | 41 | mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerView); 42 | RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getActivity(), 2); 43 | mRecyclerView.setLayoutManager(layoutManager); 44 | mRecyclerView.setHasFixedSize(true); 45 | 46 | 47 | for(int k=0;k<=10;k++) 48 | { 49 | objectbean obj = new objectbean(); 50 | obj.setTitle(String.valueOf(k)); 51 | obj.setSinger(String.valueOf(k)); 52 | obj.setDuration(String.valueOf(k)); 53 | cards.add(obj); 54 | } 55 | 56 | 57 | mAdapter = new RecyclerViewMaterialAdapter(new ObjectGridAdapter(cards,getActivity())); 58 | mRecyclerView.setAdapter(mAdapter); 59 | 60 | 61 | 62 | 63 | 64 | return view; 65 | 66 | } 67 | 68 | 69 | public void onButtonPressed(Uri uri) { 70 | 71 | } 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/ListFragment.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.net.Uri; 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | 12 | import java.util.ArrayList; 13 | 14 | 15 | public class ListFragment extends Fragment 16 | { 17 | 18 | private RecyclerView mRecyclerView; 19 | private RecyclerView.Adapter mAdapter; 20 | ArrayList cards = new ArrayList<>(); 21 | 22 | public ListFragment() 23 | { 24 | // Required empty public constructor 25 | } 26 | 27 | @Override 28 | public void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | 31 | } 32 | 33 | @Override 34 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 35 | { 36 | 37 | View view = inflater.inflate(R.layout.fragment_recyclerview, container, false); 38 | 39 | mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerView); 40 | RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity()); 41 | mRecyclerView.setLayoutManager(layoutManager); 42 | mRecyclerView.setHasFixedSize(true); 43 | 44 | 45 | for(int k=0;k<=10;k++) 46 | { 47 | objectbean obj = new objectbean(); 48 | obj.setTitle(String.valueOf(k)); 49 | obj.setSinger(String.valueOf(k)); 50 | obj.setDuration(String.valueOf(k)); 51 | cards.add(obj); 52 | } 53 | 54 | 55 | mAdapter = new RecyclerViewMaterialAdapter(new ObjectListAdapter(cards,getActivity())); 56 | mRecyclerView.setAdapter(mAdapter); 57 | 58 | 59 | 60 | return view; 61 | } 62 | 63 | // TODO: Rename method, update argument and hook method into UI event 64 | public void onButtonPressed(Uri uri) { 65 | 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.support.v4.view.ViewPager; 4 | import android.support.v7.app.ActionBarActivity; 5 | import android.os.Bundle; 6 | import android.view.Menu; 7 | import android.view.MenuItem; 8 | import android.view.View; 9 | import android.widget.Toast; 10 | 11 | import com.getbase.floatingactionbutton.FloatingActionButton; 12 | 13 | import it.neokree.materialtabs.MaterialTab; 14 | import it.neokree.materialtabs.MaterialTabHost; 15 | import it.neokree.materialtabs.MaterialTabListener; 16 | 17 | 18 | public class MainActivity extends ActionBarActivity implements MaterialTabListener { 19 | 20 | FloatingActionButton floatbut; 21 | MaterialTabHost tabHost; 22 | ViewPager pager; 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) 26 | { 27 | super.onCreate(savedInstanceState); 28 | setContentView(R.layout.activity_main); 29 | 30 | tabHost = (MaterialTabHost) findViewById(R.id.materialTabHost); 31 | pager = (ViewPager)findViewById(R.id.viewpager); 32 | floatbut = (FloatingActionButton)findViewById(R.id.addnewtask); 33 | 34 | TaskTypePagerAdapter pagerAdapter = new TaskTypePagerAdapter(getSupportFragmentManager(),MainActivity.this); 35 | pager.setAdapter(pagerAdapter); 36 | pager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { 37 | @Override 38 | public void onPageSelected(int position) { 39 | // when user do a swipe the selected tab change 40 | tabHost.setSelectedNavigationItem(position); 41 | } 42 | }); 43 | 44 | String []tabdata = {"ListView","GridView"}; 45 | // insert all tabs from pagerAdapter data 46 | for (int i = 0; i < pagerAdapter.getCount(); i++) 47 | { 48 | tabHost.addTab( 49 | tabHost.newTab() 50 | .setText(tabdata[i]) 51 | .setTabListener(MainActivity.this) 52 | ); 53 | 54 | } 55 | 56 | 57 | floatbut.setOnClickListener(new View.OnClickListener() { 58 | @Override 59 | public void onClick(View view) { 60 | Toast.makeText(MainActivity.this,"Floating Action Button",Toast.LENGTH_LONG).show(); 61 | } 62 | }); 63 | 64 | 65 | } 66 | 67 | 68 | @Override 69 | public boolean onCreateOptionsMenu(Menu menu) { 70 | // Inflate the menu; this adds items to the action bar if it is present. 71 | getMenuInflater().inflate(R.menu.menu_main, menu); 72 | return true; 73 | } 74 | 75 | @Override 76 | public boolean onOptionsItemSelected(MenuItem item) { 77 | // Handle action bar item clicks here. The action bar will 78 | // automatically handle clicks on the Home/Up button, so long 79 | // as you specify a parent activity in AndroidManifest.xml. 80 | int id = item.getItemId(); 81 | 82 | //noinspection SimplifiableIfStatement 83 | if (id == R.id.action_settings) { 84 | return true; 85 | } 86 | 87 | return super.onOptionsItemSelected(item); 88 | } 89 | 90 | @Override 91 | public void onTabSelected(MaterialTab materialTab) { 92 | pager.setCurrentItem(materialTab.getPosition()); 93 | } 94 | 95 | @Override 96 | public void onTabReselected(MaterialTab materialTab) { 97 | 98 | } 99 | 100 | @Override 101 | public void onTabUnselected(MaterialTab materialTab) { 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/ObjectGridAdapter.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.util.Log; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.Toast; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * Created by saravana on 6/14/2015. 15 | */ 16 | public class ObjectGridAdapter extends RecyclerView.Adapter 17 | { 18 | 19 | List contents; 20 | 21 | Context ctx; 22 | 23 | 24 | public ObjectGridAdapter(List contents, Context ctx) 25 | { 26 | this.ctx = ctx; 27 | this.contents = contents; 28 | } 29 | 30 | @Override 31 | public ObjectHolder onCreateViewHolder(ViewGroup parent, final int viewType) 32 | { 33 | View view = null; 34 | 35 | view = LayoutInflater.from(parent.getContext()).inflate(R.layout.grid_item_card_small, parent, false); 36 | return new ObjectHolder(view , new ObjectHolder.IMyViewHolderClicks() 37 | { 38 | @Override 39 | public void onPlay(View caller) 40 | { 41 | Log.e("getting data", "view"+contents.get((int)caller.getTag()).getTitle()); 42 | 43 | /* HomePage.songtitle.setText(contents.get((int)caller.getTag()).getFilename()); 44 | HomePage.songplaypause.setImageDrawable(null); 45 | HomePage.songplaypause.setImageResource(android.R.drawable.ic_media_pause); 46 | try 47 | { 48 | HomePage.mp.reset(); 49 | HomePage.mp.setDataSource(ctx, Uri.parse("file://"+contents.get((int) caller.getTag()).getUri())); 50 | HomePage.mp.prepare(); 51 | HomePage.mp.start(); 52 | HomePage. mp.setOnPreparedListener((MediaPlayer.OnPreparedListener) ctx); 53 | HomePage.mp.prepareAsync(); 54 | 55 | } 56 | catch (Exception e) 57 | { 58 | e.printStackTrace(); 59 | }*/ 60 | 61 | Toast.makeText(ctx,contents.get((int)caller.getTag()).getTitle(),Toast.LENGTH_LONG).show(); 62 | 63 | } 64 | }){}; 65 | 66 | } 67 | 68 | @Override 69 | public void onBindViewHolder(ObjectHolder holder, int position) 70 | { 71 | objectbean song = contents.get(position); 72 | holder.bindSong(song,position); 73 | } 74 | 75 | 76 | 77 | @Override 78 | public int getItemCount() 79 | { 80 | return contents.size(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/ObjectHolder.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | 7 | 8 | 9 | /** 10 | * Created by saravana on 6/14/2015. 11 | */ 12 | public class ObjectHolder extends RecyclerView.ViewHolder implements View.OnClickListener 13 | { 14 | TextView textTitle; 15 | TextView textDuration; 16 | 17 | TextView textSinger; 18 | public IMyViewHolderClicks mListener; 19 | 20 | View vi; 21 | 22 | objectbean msong; 23 | 24 | public ObjectHolder(View itemView, IMyViewHolderClicks listener) 25 | { 26 | super(itemView); 27 | mListener = listener; 28 | 29 | vi = itemView; 30 | textTitle = (TextView) itemView.findViewById( R.id.textTitle); 31 | textDuration = (TextView) itemView.findViewById(R.id.textDuration); 32 | textSinger = (TextView) itemView.findViewById(R.id.textSinger); 33 | 34 | itemView.setOnClickListener(this); 35 | 36 | } 37 | 38 | public void bindSong(objectbean song,int pos) 39 | { 40 | msong = song; 41 | vi.setTag(pos); 42 | textTitle.setText(song.getTitle()); 43 | textDuration.setText(song.getSinger()); 44 | textSinger.setText(song.getDuration()); 45 | 46 | } 47 | 48 | @Override 49 | public void onClick(View view) 50 | { 51 | mListener.onPlay(view); 52 | } 53 | 54 | public static interface IMyViewHolderClicks { 55 | public void onPlay(View caller); 56 | 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/ObjectListAdapter.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.util.Log; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.Toast; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * Created by saravana on 6/14/2015. 15 | */ 16 | public class ObjectListAdapter extends RecyclerView.Adapter 17 | { 18 | 19 | List contents; 20 | 21 | Context ctx; 22 | 23 | 24 | public ObjectListAdapter(List contents, Context ctx) 25 | { 26 | this.ctx = ctx; 27 | this.contents = contents; 28 | } 29 | 30 | @Override 31 | public ObjectHolder onCreateViewHolder(ViewGroup parent, final int viewType) 32 | { 33 | View view = null; 34 | 35 | view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_card_small, parent, false); 36 | return new ObjectHolder(view , new ObjectHolder.IMyViewHolderClicks() 37 | { 38 | @Override 39 | public void onPlay(View caller) 40 | { 41 | Log.e("getting data", "view"+contents.get((int)caller.getTag()).getTitle()); 42 | 43 | /* HomePage.songtitle.setText(contents.get((int)caller.getTag()).getFilename()); 44 | HomePage.songplaypause.setImageDrawable(null); 45 | HomePage.songplaypause.setImageResource(android.R.drawable.ic_media_pause); 46 | try 47 | { 48 | HomePage.mp.reset(); 49 | HomePage.mp.setDataSource(ctx, Uri.parse("file://"+contents.get((int) caller.getTag()).getUri())); 50 | HomePage.mp.prepare(); 51 | HomePage.mp.start(); 52 | HomePage. mp.setOnPreparedListener((MediaPlayer.OnPreparedListener) ctx); 53 | HomePage.mp.prepareAsync(); 54 | 55 | } 56 | catch (Exception e) 57 | { 58 | e.printStackTrace(); 59 | }*/ 60 | 61 | Toast.makeText(ctx,contents.get((int)caller.getTag()).getTitle(),Toast.LENGTH_LONG).show(); 62 | 63 | } 64 | }){}; 65 | 66 | } 67 | 68 | @Override 69 | public void onBindViewHolder(ObjectHolder holder, int position) 70 | { 71 | objectbean song = contents.get(position); 72 | holder.bindSong(song,position); 73 | } 74 | 75 | 76 | 77 | @Override 78 | public int getItemCount() { 79 | return contents.size(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/RecyclerViewMaterialAdapter.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | public class RecyclerViewMaterialAdapter extends RecyclerView.Adapter { 9 | 10 | //the constants value of the header view 11 | static final int TYPE_PLACEHOLDER = Integer.MIN_VALUE; 12 | 13 | //the size taken by the header 14 | private int mPlaceholderSize = 0; 15 | 16 | //the actual RecyclerView.Adapter 17 | private RecyclerView.Adapter mAdapter; 18 | 19 | /** 20 | * Construct the RecyclerViewMaterialAdapter, which inject a header into an actual RecyclerView.Adapter 21 | * 22 | * @param adapter The real RecyclerView.Adapter which displays content 23 | */ 24 | public RecyclerViewMaterialAdapter(RecyclerView.Adapter adapter) { 25 | this.mAdapter = adapter; 26 | } 27 | 28 | /** 29 | * Construct the RecyclerViewMaterialAdapter, which inject a header into an actual RecyclerView.Adapter 30 | * 31 | * @param adapter The real RecyclerView.Adapter which displays content 32 | * @param placeholderSize The number of placeholder items before real items, default is 1 33 | */ 34 | public RecyclerViewMaterialAdapter(RecyclerView.Adapter adapter, int placeholderSize) { 35 | this.mAdapter = adapter; 36 | mPlaceholderSize = placeholderSize; 37 | } 38 | 39 | @Override 40 | public int getItemViewType(int position) { 41 | if (position < mPlaceholderSize) 42 | return TYPE_PLACEHOLDER; 43 | else 44 | return mAdapter.getItemViewType(position - mPlaceholderSize); //call getItemViewType on the adapter, less mPlaceholderSize 45 | } 46 | 47 | //dispatch getItemCount to the actual adapter, add mPlaceholderSize 48 | @Override 49 | public int getItemCount() { 50 | return mAdapter.getItemCount() + mPlaceholderSize; 51 | } 52 | 53 | //add the header on first position, else display the true adapter's cells 54 | @Override 55 | public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 56 | View view = null; 57 | 58 | switch (viewType) { 59 | case TYPE_PLACEHOLDER: 60 | { 61 | view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_card_big, parent, false); 62 | return new RecyclerView.ViewHolder(view) { 63 | }; 64 | } 65 | default: 66 | return mAdapter.onCreateViewHolder(parent, viewType); 67 | } 68 | } 69 | 70 | //dispatch onBindViewHolder on the actual mAdapter 71 | @Override 72 | public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { 73 | switch (getItemViewType(position)) { 74 | case TYPE_PLACEHOLDER: 75 | break; 76 | default: 77 | mAdapter.onBindViewHolder(holder, position - mPlaceholderSize); 78 | break; 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/TaskTypePagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.content.Context; 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentPagerAdapter; 7 | 8 | 9 | 10 | import java.util.Random; 11 | 12 | public class TaskTypePagerAdapter extends FragmentPagerAdapter { 13 | 14 | private int pagerCount = 2; 15 | 16 | Context ctx; 17 | 18 | 19 | final Fragment[] fragments = 20 | { 21 | 22 | 23 | 24 | }; 25 | 26 | private Random random = new Random(); 27 | 28 | public TaskTypePagerAdapter(FragmentManager fm, Context ctx) 29 | { 30 | super(fm); 31 | 32 | this.ctx = ctx; 33 | 34 | } 35 | 36 | @Override public Fragment getItem(int i) 37 | { 38 | //return ColorFragment.newInstance(0xff000000 | random.nextInt(0x00ffffff)); 39 | 40 | //return ColorFragment.newInstance(0xffffffff); 41 | 42 | if(i==0) 43 | { 44 | return new ListFragment(); 45 | } 46 | else 47 | { 48 | return new GridFragment(); 49 | } 50 | 51 | 52 | 53 | } 54 | 55 | 56 | 57 | @Override public int getCount() { 58 | return pagerCount; 59 | } 60 | 61 | 62 | 63 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/TestRecyclerViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | import java.util.List; 9 | 10 | 11 | public class TestRecyclerViewAdapter extends RecyclerView.Adapter { 12 | 13 | List contents; 14 | 15 | static final int TYPE_HEADER = 0; 16 | static final int TYPE_CELL = 1; 17 | 18 | public TestRecyclerViewAdapter(List contents) 19 | { 20 | this.contents = contents; 21 | } 22 | 23 | @Override 24 | public int getItemViewType(int position) { 25 | switch (position) { 26 | case 0: 27 | return TYPE_HEADER; 28 | default: 29 | return TYPE_CELL; 30 | } 31 | } 32 | 33 | @Override 34 | public int getItemCount() { 35 | return contents.size(); 36 | } 37 | 38 | @Override 39 | public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) 40 | { 41 | View view = null; 42 | 43 | switch (viewType) 44 | { 45 | case TYPE_HEADER: { 46 | view = LayoutInflater.from(parent.getContext()) 47 | .inflate(R.layout.list_item_card_big, parent, false); 48 | return new RecyclerView.ViewHolder(view) { 49 | }; 50 | } 51 | case TYPE_CELL: { 52 | view = LayoutInflater.from(parent.getContext()) 53 | .inflate(R.layout.list_item_card_small, parent, false); 54 | return new RecyclerView.ViewHolder(view) { 55 | }; 56 | } 57 | } 58 | return null; 59 | } 60 | 61 | 62 | @Override 63 | public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { 64 | switch (getItemViewType(position)) { 65 | case TYPE_HEADER: 66 | break; 67 | case TYPE_CELL: 68 | break; 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hopend/saravana/cardlistgridview/objectbean.java: -------------------------------------------------------------------------------- 1 | package com.hopend.saravana.cardlistgridview; 2 | 3 | public class objectbean { 4 | private String title; 5 | private String duration; 6 | private String singer; 7 | private String filename; 8 | private String uri; 9 | 10 | public String getFilename() { 11 | return filename; 12 | } 13 | public void setFilename(String filename) { 14 | this.filename = filename; 15 | } 16 | public String getTitle() { 17 | return title; 18 | } 19 | public void setTitle(String title) { 20 | this.title = title; 21 | } 22 | public String getDuration() { 23 | return duration; 24 | } 25 | public void setDuration(String duration) { 26 | this.duration = duration; 27 | } 28 | public String getSinger() { 29 | return singer; 30 | } 31 | public void setSinger(String singer) { 32 | this.singer = singer; 33 | } 34 | 35 | public String getUri() { 36 | return uri; 37 | } 38 | 39 | public void setUri(String uri) { 40 | this.uri = uri; 41 | } 42 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saravanaml/CardListGridView/c533f199660b759014e5f37573aa3597a7ddac5d/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saravanaml/CardListGridView/c533f199660b759014e5f37573aa3597a7ddac5d/app/src/main/res/drawable-hdpi/plus.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saravanaml/CardListGridView/c533f199660b759014e5f37573aa3597a7ddac5d/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saravanaml/CardListGridView/c533f199660b759014e5f37573aa3597a7ddac5d/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saravanaml/CardListGridView/c533f199660b759014e5f37573aa3597a7ddac5d/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 18 | 19 | 20 | 30 | 31 | 38 | 39 | 40 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_eads.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_recyclerview.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/grid_item_card_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 19 | 20 | 23 | 24 | 29 | 30 | 35 | 36 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_card_big.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_card_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 19 | 20 | 23 | 24 | 29 | 30 | 35 | 36 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #B2000000 5 | #e5e5e5 6 | #808080 7 | #fafafa 8 | #f1f1f1 9 | #e91e63 10 | #ff0000 11 | #ec407a 12 | #805677fc 13 | #80738ffe 14 | 15 | #ff0000 16 | #304f9f 17 | 18 | #207BC1 19 | #f5cc0b 20 | #888b91 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 10dp 6 | 8dp 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CardListGridView 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.0.0-rc2' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saravanaml/CardListGridView/c533f199660b759014e5f37573aa3597a7ddac5d/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------