-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
146 additions
and
30 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
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
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
82 changes: 82 additions & 0 deletions
82
MaterialSample/app/src/main/java/com/suleiman/material/activities/QuickReturnActivity.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,82 @@ | ||
package com.suleiman.material.activities; | ||
|
||
import android.os.Bundle; | ||
import android.support.design.widget.CoordinatorLayout; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.LinearLayoutManager; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
|
||
import com.suleiman.material.R; | ||
import com.suleiman.material.adapter.SimpleRecyclerAdapter; | ||
import com.suleiman.material.model.VersionModel; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by Suleiman on 15-06-2015. | ||
*/ | ||
public class QuickReturnActivity extends AppCompatActivity { | ||
RecyclerView recyclerView; | ||
SimpleRecyclerAdapter adapter; | ||
CoordinatorLayout mCoordinatorLayout; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
setContentView(R.layout.activity_quick_return); | ||
|
||
final Toolbar toolbar = (Toolbar) findViewById(R.id.quickreturn_toolbar); | ||
setSupportActionBar(toolbar); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
|
||
mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.quickreturn_coordinator); | ||
recyclerView = (RecyclerView) findViewById(R.id.quickreturn_list); | ||
|
||
recyclerView.setHasFixedSize(true); | ||
recyclerView.setLayoutManager(new LinearLayoutManager(this)); | ||
|
||
List<String> listData = new ArrayList<String>(); | ||
int ct = 0; | ||
for (int i = 0; i < VersionModel.data.length * 3; i++) { | ||
listData.add(VersionModel.data[ct]); | ||
ct++; | ||
if (ct == VersionModel.data.length) { | ||
ct = 0; | ||
} | ||
} | ||
|
||
if (adapter == null) { | ||
adapter = new SimpleRecyclerAdapter(listData); | ||
recyclerView.setAdapter(adapter); | ||
} | ||
|
||
|
||
} | ||
|
||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
getMenuInflater().inflate(R.menu.menu_main, menu); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
|
||
switch (item.getItemId()) { | ||
case R.id.action_settings: | ||
return true; | ||
case android.R.id.home: | ||
supportFinishAfterTransition(); | ||
return true; | ||
} | ||
|
||
return super.onOptionsItemSelected(item); | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
MaterialSample/app/src/main/res/layout/activity_quick_return.xml
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,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/quickreturn_coordinator" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<android.support.design.widget.AppBarLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:id="@+id/quickreturn_toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | ||
app:layout_scrollFlags="scroll|enterAlways" | ||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> | ||
|
||
</android.support.design.widget.AppBarLayout> | ||
|
||
<android.support.v7.widget.RecyclerView | ||
android:id="@+id/quickreturn_list" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> | ||
|
||
|
||
</android.support.design.widget.CoordinatorLayout> |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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