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 com.bruce.ghclient.network; | |
import android.text.TextUtils; | |
import android.widget.Toast; | |
import com.bruce.ghclient.GHClientApp; | |
import com.bruce.ghclient.network.github.GithubPreManager; | |
import com.google.gson.ExclusionStrategy; | |
import com.google.gson.FieldAttributes; | |
import com.google.gson.Gson; |
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 com.brucetoo.yingke; | |
import android.content.Context; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
/** | |
* Created by Bruce too | |
* On 2016/2/26 |
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 com.daimajia.androidanimations; | |
import android.content.Context; | |
import android.view.View; | |
import android.view.ViewGroup; | |
/** | |
* Created by Bruce Too | |
* On 2/19/16. | |
* At 23:20 |
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
private void initPopupWindow() { | |
popupWindow = new ListPopupWindow(getActivity()); | |
//为了适配某些手机而采用此种做法 | |
popupWindow.setAdapter(new QuickAdapter<String>(getActivity(),R.layout.xxxxx, Arrays.asList(tabs)) { | |
@Override | |
protected void convert(BaseAdapterHelper helper, final String item) { | |
helper.setText(R.id.xxx),item); | |
helper.setOnClickListener(R.id.xxx, new View.OnClickListener() { | |
@Override |
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
private Dictionary<Integer, Integer> listViewItemHeights = new Hashtable<Integer, Integer>(); | |
private int getListViewScrollY(AbsListView view) { | |
View c = view.getChildAt(0); | |
int scrollY = -c.getTop(); | |
listViewItemHeights.put(view.getFirstVisiblePosition(), c.getHeight()); | |
for (int i = 0; i < view.getFirstVisiblePosition(); ++i) { | |
if (listViewItemHeights.get(i) != null) | |
scrollY += listViewItemHeights.get(i); //顶部消失的所有Item的高度 | |
} | |
return scrollY; |
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 com.netease.cc.mgsdk.util; | |
import java.lang.reflect.Field; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.view.View; | |
public class IdentifierUtil { | |
/** |
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 com.netease.cc.widget.pulltorefresh; | |
import android.content.Context; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
/** | |
* Created by Bruce too | |
* On 2015/12/3 |
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
/* | |
* Copyright 2012 Google Inc. | |
* | |
* 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 |
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.app.Activity; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Stack; | |
/** | |
* activity堆栈式管理 | |
*/ | |
public class ActivityManager { |
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.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |