Skip to content

Instantly share code, notes, and snippets.

View Suleiman19's full-sized avatar

Suleiman Ali Shakir Suleiman19

View GitHub Profile
@Suleiman19
Suleiman19 / wifi_buddy_privacy_policy.html
Last active March 12, 2017 12:10
Wifi Buddy Privacy Policy
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> Suleiman Ali Shakir built the Wifi Buddy: Live Monitor app as an Ad Supported app. This SERVICE is provided by Suleiman Ali Shakir at no cost and is intended for use as is. </p> <p>This page is used to inform website visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. </p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. </p> <p>The terms used in this Privacy Policy have the same meanings as in our Terms and Cond
@Suleiman19
Suleiman19 / AnimateToolbar.java
Last active March 12, 2017 16:39
Flexible Space with Image pattern UI setup and menu scroll listener
public class AnimateToolbar extends AppCompatActivity {
private CollapsingToolbarLayout collapsingToolbar;
private AppBarLayout appBarLayout;
private RecyclerView recyclerView;
private DessertAdapter dessertAdapter;
private Menu collapsedMenu;
private boolean appBarExpanded = true;
@Suleiman19
Suleiman19 / TabsHeaderActivity.java
Last active April 1, 2017 06:47
Dummy Fragment that contains a scrollable list to demonstrate parallax scroll effect.
public static class DummyFragment extends Fragment {
int color;
public DummyFragment() {
}
@SuppressLint("ValidFragment")
public DummyFragment(int color) {
this.color = color;
}
@Suleiman19
Suleiman19 / TabsHeaderActivity.java
Created April 1, 2017 07:03
Palette API that fetches a dynamic color from a Bitmap and also includes fallback colors on failure.
try {
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.header);
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
@SuppressWarnings("ResourceType")
@Override
public void onGenerated(Palette palette) {
int vibrantColor = palette.getVibrantColor(R.color.primary_500);
int vibrantDarkColor = palette.getDarkVibrantColor(R.color.primary_700);
collapsingToolbarLayout.setContentScrimColor(vibrantColor);
@Suleiman19
Suleiman19 / TabsHeaderActivity.java
Created April 1, 2017 06:51
A simple ViewPager adapter that populates Fragments to create the parallax scrolling effect for Tabs.
private static class ViewPagerAdapter extends FragmentPagerAdapter {
private final List<Fragment> mmFragmentTitleList FragmentList = new ArrayList<>();
private final List<String> = new ArrayList<>();
public ViewPagerAdapter(FragmentManager manager) {
super(manager);
}
@Override
public Fragment getItem(int position) {
@Suleiman19
Suleiman19 / activity_parallax_tabs.xml
Last active August 19, 2018 18:16
Android XML Layout for Parallax scrolling with header Tabs. Uses Design Support Library.
<?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/htab_maincontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
@Suleiman19
Suleiman19 / PaginationScrollListener.java
Last active October 23, 2018 07:15
RecyclerView OnScrollListener for Pagination support
public abstract class PaginationScrollListener extends RecyclerView.OnScrollListener {
LinearLayoutManager layoutManager;
public PaginationScrollListener(LinearLayoutManager layoutManager) {
this.layoutManager = layoutManager;
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
@Suleiman19
Suleiman19 / RecyclerView Click Listener Util
Last active February 1, 2019 08:05
Small Util class to set a click listener for RecyclerViews
public class CustomRecyclerClickListener implements RecyclerView.OnItemTouchListener {
private OnItemClickListener mListener;
public interface OnItemClickListener {
public void onItemClick(View view, int position);
}
GestureDetector mGestureDetector;
public CustomRecyclerClickListener(Context context, OnItemClickListener listener) {
@Suleiman19
Suleiman19 / Header.java
Last active June 27, 2019 14:31
Sample code snippets for using mikepenz/FastAdapter library and its various features
public class Header extends AbstractItem<Header, Header.ViewHolder> {
String title;
public Header(String title) {
this.title = title;
}
public String getTitle() {
return title;
@Suleiman19
Suleiman19 / activity_animate_toolbar.xml
Last active June 25, 2020 13:39
Flexible Space with Image pattern XML layout. Using Design Support library widgets.
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout