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
public class TestFragment extends Fragment { | |
... | |
@Override | |
public void onDataLoaded(List<Item> items) { | |
... | |
// Call this method once you loaded your items and just before the call to Adapter#notifiyDataSetChanged() | |
recyclerView.scheduleLayoutAnimation(); |
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
@Override | |
public PaletteViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { | |
View itemView = LayoutInflater. | |
from(viewGroup.getContext()). | |
inflate(R.layout.card_view, viewGroup, false); | |
itemView.setOnClickListener(new View.OnClickListener() { | |
public void onClick(View v) { | |
// Creating the ScrollingActivity Intent with the extras data | |
Intent intent = new Intent(this, ScrollingActivity.class); |
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
<android.support.v7.widget.Toolbar | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="?attr/actionBarSize" | |
android:background="?attr/colorPrimary" | |
android:elevation="4dp" | |
app:popupTheme="@style/toolbar_popup_style" | |
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | |
style="@style/toolbar_style"/> | |
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
public class MainActivity extends AppCompatActivity { | |
// So, we move the DECLARATION of mainLayout outside of the onCreate method. | |
// We put it here, in the MainActivity | |
CoordinatorLayout mainLayout; | |
public void onCreate(Bundle savedInstanceState) { | |
... | |
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
package kuid.kuid.ui.widget; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Typeface; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.util.LruCache; | |
import android.widget.TextView; |
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
/* | |
* Java | |
*/ | |
// To start an Activity: | |
private void startActivityWithAnimation(Intent intent) { | |
startActivity(intent); | |
overridePendingTransition(R.anim.slide_in_from_right, R.anim.slide_out_to_left); | |
} |
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
public class MainActivity { | |
private RecyclerView recyclerView; | |
private ArrayList<Country> countries; | |
... | |
@Override | |
public void onCreate(Bundle savedInstanceState) { |
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
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.TextView; | |
import java.util.ArrayList; |