Example #1
0
 @Override
 public View onCreateView(
     LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   View v = inflater.inflate(R.layout.fragment_feed, container, false);
   ButterKnife.inject(this, v);
   if (AppSharePreferences.getFollowFlag(getActivity())) {
     listLayout = mListViewStub.inflate();
     initListView(listLayout);
   } else {
     settingLayout = mSetting.inflate();
     initSettingView(settingLayout);
   }
   return v;
 }
Example #2
0
 public void onEventMainThread(SubscriptionAddActivity.FollowFlagEvent event) {
   if (event.flag) {
     if (mSetting != null) mSetting.setVisibility(View.GONE);
     if (listLayout == null) {
       listLayout = mListViewStub.inflate();
       initListView(listLayout);
     } else {
       listLayout.setVisibility(View.VISIBLE);
       data.clear();
       adapter.notifyDataSetChanged();
       mEmptyView.show(true);
       mEmptyView.onLoading();
       request(Urls.SERVER_PATH + "/user/feeds", 0);
     }
   } else {
     stopRefreshNews();
     if (mListViewStub != null) mListViewStub.setVisibility(View.GONE);
     if (settingLayout == null) {
       settingLayout = mSetting.inflate();
       initSettingView(settingLayout);
     } else settingLayout.setVisibility(View.VISIBLE);
   }
 }