Skip to content

Instantly share code, notes, and snippets.

Munish Kapoor manishkpr

Block or report user

Report or block manishkpr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@manishkpr
manishkpr / content_main.xml
Created Nov 11, 2015
Android Material Tabs
View content_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
View recycle_view_common_items.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_margin="20dip"
android:id="@+id/text"
@manishkpr
manishkpr / MainActivity.java
Created Nov 11, 2015
Android Material Tabs
View MainActivity.java
public class MainActivity extends AppCompatActivity {
@Bind(R.id.toolbar) Toolbar toolbar;
@Bind(R.id.fab) FloatingActionButton fab;
@Bind(R.id.tabs) TabLayout tabs;
@Bind(R.id.pager) ViewPager pager;
MainPagerAdapter adapter;
CharSequence Titles[]={"TAB 1","TAB 2"};
View CommonRecycleAdapter.java
package com.webheavens.manishkprmaterialtabs.adapters;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.webheavens.manishkprmaterialtabs.R;
View MainPagerAdapter.java
package com.webheavens.manishkprmaterialtabs.adapters;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import com.webheavens.manishkprmaterialtabs.fragments.PostsFragment;
/**
@manishkpr
manishkpr / PostsFragment.java
Created Nov 11, 2015
Android Material Tabs
View PostsFragment.java
package com.webheavens.manishkprmaterialtabs.fragments;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@manishkpr
manishkpr / activity_main.xml
Created Nov 11, 2015
Android Material Design Tabs Collapsible
View activity_main.xml
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
View UIActivity.java
package com.materialdesign.chris.materialdesignexperimenting;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewAnimationUtils;
@manishkpr
manishkpr / ControllableAppBarLayout.java
Created Aug 2, 2016 — forked from blipinsk/ControllableAppBarLayout.java
An extension of Android AppBarLayout, that allows to programatically change the CollapsibleToolbarLayout state
View ControllableAppBarLayout.java
/**
* Copyright 2015 Bartosz Lipinski
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@manishkpr
manishkpr / OnItemSelectedListener.java
Created Dec 27, 2016 — forked from andreynovikov/OnItemSelectedListener.java
Complete working solution for Android action bar tabs with fragments having separate back stack for each tab.
View OnItemSelectedListener.java
// Custom interface that enables communication between Fragment and its Activity
public interface OnItemSelectedListener
{
public void onItemSelected(String item);
}
You can’t perform that action at this time.