This file contains hidden or 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 abstract class CyclePagerAdapter<T> extends PagerAdapter implements ViewPager.OnPageChangeListener { | |
protected List<T> mItemList = null; | |
private WeakReference<CycleViewPager> mViewPagerRef = null; | |
public CyclePagerAdapter(@NonNull List<T> list, @NonNull CycleViewPager cycleViewPager) { | |
if (list.size() <= 1) { | |
// needn't to support infinite cycle | |
mItemList = new ArrayList<>(list); | |
} else { | |
// refer: https://maniacdev.com/2013/08/tutorial-how-to-create-an-infinite-scrolling-uicollectionview |
This file contains hidden or 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
{ | |
"formatVersion": 1, | |
"database": { | |
"version": 2, | |
"identityHash": "99c7946712f93a4d723efbe10a500eb0", | |
"entities": [ | |
{ | |
"tableName": "Users", | |
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`mId` INTEGER NOT NULL, `mUserName` TEXT, PRIMARY KEY(`mId`))", | |
"fields": [ |
This file contains hidden or 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
{ | |
"formatVersion": 1, | |
"database": { | |
"version": 1, | |
"identityHash": "99c7946712f93a4d723efbe10a500eb0", | |
"entities": [ | |
{ | |
"tableName": "users", | |
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userid` INTEGER NOT NULL, `username` TEXT, PRIMARY KEY(`userid`))", | |
"fields": [ |
This file contains hidden or 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 android.support.design.widget; | |
import android.support.v4.view.ViewCompat; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import java.lang.ref.WeakReference; | |
/** |
This file contains hidden or 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
private static class BottomSheetViewPagerListener extends ViewPager.SimpleOnPageChangeListener { | |
private final ViewPager mViewPager; | |
private final ViewPagerBottomSheetBehavior<View> mBehavior; | |
private BottomSheetViewPagerListener(ViewPager viewPager, View bottomSheetParent) { | |
mViewPager = viewPager; | |
mBehavior = ViewPagerBottomSheetBehavior.from(bottomSheetParent); | |
} | |
@Override |
This file contains hidden or 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 com.google.android.youtube.player; | |
public final class YouTubePlayerView extends ViewGroup implements Provider { | |
private final YouTubePlayerView.b c; | |
private com.google.android.youtube.player.internal.b d; | |
private View f; | |
private Provider h; | |
private Bundle i; | |
.... |
This file contains hidden or 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 com.google.android.youtube.player; | |
public class YouTubeBaseActivity extends Activity { | |
private YouTubeBaseActivity.a a; | |
private YouTubePlayerView b; | |
private Bundle d; | |
public YouTubeBaseActivity() { | |
} |
This file contains hidden or 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 com.google.android.youtube.player; | |
public class YouTubePlayerFragment extends Fragment implements Provider { | |
private final YouTubePlayerFragment.a a = new YouTubePlayerFragment.a((byte)0); | |
private Bundle b; | |
private YouTubePlayerView c; | |
private String d; | |
private OnInitializedListener e; | |
private boolean f; |
This file contains hidden or 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 com.google.android.youtube.player; | |
public class YouTubePlayerViewUtils { | |
public static YouTubePlayerView createYouTubePlayerView(final Activity activity, | |
final YouTubePlayer.OnInitializedListener initializedListener, | |
final Bundle playerState) { | |
// create YoutubePlayerView by private-package constructor | |
final YouTubePlayerView view = new YouTubePlayerView(context, /*AttributeSet*/ null, /*defStyleAttr*/ 0, | |
new YouTubePlayerView.b() { |
This file contains hidden or 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 com.google.android.youtube.player.YouTubePlayer.OnInitializedListener; | |
public class YouTubeDemoFragment extends android.support.v4.app.Fragment { | |
private YouTubePlayerView mYouTubePlayerView; | |
private Bundle mYouTubePlayerState; | |
private OnInitializedListener mOnYoutubePlayerInitializedListener; | |
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { |