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 | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
View layout = inflater.inflate(R.layout.layout_comment_dialog, null); | |
this.setContentView(layout); | |
Window dialog_window = this.getWindow(); | |
if (dialog_window != null) { |
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 | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
View layout = inflater.inflate(R.layout.layout_comment_dialog, null); | |
this.setContentView(layout); | |
Window dialog_window = this.getWindow(); | |
if (dialog_window != null) { |
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
edittext.requestFocus(); // 没有这一句不会弹出,至少我遇到的情况是这样 | |
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); | |
imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED); |
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 interface OnSoftKeyBoardShowListener { | |
void hasShow(boolean isShow); | |
} | |
/** | |
* 判断软键盘是否弹出 | |
*/ | |
private class MyOnGlobalLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener { | |
private OnSoftKeyBoardShowListener listener; | |
private View rootView; |
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 DividerItemDecoration extends RecyclerView.ItemDecoration { | |
/* | |
* RecyclerView的布局方向,默认先赋值 | |
* 为纵向布局 | |
* RecyclerView 布局可横向,也可纵向 | |
* 横向和纵向对应的分割想画法不一样 | |
* */ | |
private int mOrientation = LinearLayoutManager.VERTICAL; |
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
/** | |
* 通过反射修改TabLayout Indicator的宽度(仅在Android 4.2及以上生效) | |
*/ | |
private void setUpIndicatorWidth(TabLayout tabLayout) { | |
Class<?> tabLayoutClass = tabLayout.getClass(); | |
Field tabStrip = null; | |
try { | |
tabStrip = tabLayoutClass.getDeclaredField("mTabStrip"); | |
tabStrip.setAccessible(true); | |
} catch (NoSuchFieldException e) { |
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 void scrollToTop() { | |
if (null != adapter && adapter.getCount() > 0 && null != listView) { | |
//强制停止ListView滚动 | |
listView.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_CANCEL, 0, 0, 0)); | |
//如果item过多,则先停在某一项上 | |
if (listView.getFirstVisiblePosition() > 8) | |
listView.setSelection(8); |
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
*.gslbsvc.net.cn; | |
*.chinacache.com.cn; | |
*.ccgslb.net; | |
*.gslbsvc.com.cn; | |
*.cdnsvc.cn; | |
*.ccgslb.cn; | |
*.cdn2cdn.net; | |
*.blueit.org.cn; | |
*.cc-1.com; | |
*.cdnsvc.net; |