@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
	                         Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_browse, container, false);
		latestWallpaperIDs = new ArrayList<>();
		randomWallpapers = new ArrayList<>();
		mSfwSwitch = (Switch) view.findViewById(R.id.sfwSwitch);
		mSketchySwitch = (Switch) view.findViewById(R.id.sketchySwitch);
		mSfwSwitch.setChecked(true);
		//Latest
		mLatestRecyclerView = (RecyclerView) view.findViewById(R.id.latestRecycler);
		mLatestRecyclerView.setHasFixedSize(true);
		mLatestLayoutManager = new LinearLayoutManager(view.getContext(), LinearLayoutManager.HORIZONTAL, false);
		mLatestRecyclerView.setLayoutManager(mLatestLayoutManager);
		mLatestAdapter = new ImageRecyclerAdapter(latestWallpaperIDs);
		mLatestRecyclerView.setAdapter(mLatestAdapter);
		SharedPreferences mSharedPref = WallhavenBrowser.getContext().getSharedPreferences("com.sirkitboard.wallhavenbrowser",  WallhavenBrowser.getContext().MODE_PRIVATE);
		String purity = mSharedPref.getString("purity","100");
		mSfwSwitch.setChecked(purity.charAt(0) == '1');
		mSketchySwitch.setChecked(purity.charAt(1) == '1');
		//Random
		mRandomRecyclerView = (RecyclerView) view.findViewById(R.id.randomRecycler);
		mRandomRecyclerView.setHasFixedSize(true);
		mRandomLayoutManager = new LinearLayoutManager(view.getContext(), LinearLayoutManager.HORIZONTAL, false);
		mRandomRecyclerView.setLayoutManager(mRandomLayoutManager);
		mRandomAdapter = new ImageRecyclerAdapter(randomWallpapers);
		mRandomRecyclerView.setAdapter(mRandomAdapter);
		refresh();

		return view;
	}
  @Nullable
  @Override
  public View onCreateView(
      LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_movie_summary, container, false);

    viewBackdrops = (BackdropViewPager) view.findViewById(R.id.backdrop_pager);
    viewTitle = (TextView) view.findViewById(R.id.title);
    viewPoster = (ImageView) view.findViewById(R.id.poster);
    viewProgressBar = (ProgressBar) view.findViewById(R.id.progress_bar);
    viewTagLine = (TextView) view.findViewById(R.id.tagline);
    viewReleaseDate = (TextView) view.findViewById(R.id.release_date);
    viewRuntime = (TextView) view.findViewById(R.id.runtime);
    viewOverview = (TextView) view.findViewById(R.id.overview);
    viewGenres = (TextView) view.findViewById(R.id.genres);

    viewCastList = (RecyclerView) view.findViewById(R.id.cast_list);
    viewCastList.setHasFixedSize(true);
    viewCastList.setLayoutManager(
        new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));

    viewCrewList = (RecyclerView) view.findViewById(R.id.crew_list);
    viewCrewList.setHasFixedSize(true);
    viewCrewList.setLayoutManager(
        new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));

    viewReviews = (ReviewsView) view.findViewById(R.id.reviews_view);

    return view;
  }
Beispiel #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_nearby);
    mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    // If the adapter is null, then Bluetooth is not supported
    if (mBluetoothAdapter == null) {
      Toast.makeText(this, "Bluetooth is not available", Toast.LENGTH_LONG).show();
      finish();
    }
    doDiscovery();
    setResult(Activity.RESULT_CANCELED);

    ArrayList<String> pairedDevices = new ArrayList<String>();
    mNewDevicesArrayAdapter = new ArrayList<String>();
    mRecyclerView = (RecyclerView) findViewById(R.id.paired_recycler_view);
    mRecyclerView.setHasFixedSize(true);
    mAdapter = new BluetoothRecyclerAdapter(this, pairedDevices);
    mRecyclerView.setAdapter(mAdapter);
    mLayoutManager = new LinearLayoutManager(this);
    mRecyclerView.setLayoutManager(mLayoutManager);

    RecyclerView mNewRecyclerView = (RecyclerView) findViewById(R.id.available_recycler_view);
    mNewRecyclerView.setHasFixedSize(true);
    RecyclerView.Adapter mNewAdapter = new BluetoothRecyclerAdapter(this, mNewDevicesArrayAdapter);
    mNewRecyclerView.setAdapter(mNewAdapter);
    RecyclerView.LayoutManager mNewLayoutManager = new LinearLayoutManager(this);
    mNewRecyclerView.setLayoutManager(mNewLayoutManager);

    IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
    this.registerReceiver(mReceiver, filter);

    // Register for broadcasts when discovery has finished
    filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
    this.registerReceiver(mReceiver, filter);

    Set<BluetoothDevice> pairedDevicesSet = mBluetoothAdapter.getBondedDevices();

    // If there are paired devices, add each one to the ArrayAdapter
    if (pairedDevicesSet.size() > 0) {
      findViewById(R.id.title_paired_devices).setVisibility(View.VISIBLE);
      for (BluetoothDevice device : pairedDevicesSet) {
        pairedDevices.add(device.getName() + "\n" + device.getAddress());
      }
    } else {
      String noDevices = getResources().getText(R.string.none_paired).toString();
      pairedDevices.add(noDevices);
    }
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    mainView = inflater.inflate(R.layout.tweet_list_fragment_main, container, false);
    mCityName = getActivity().getIntent().getStringExtra("city_name");
    mCategoryName = getActivity().getIntent().getStringExtra("category_name");
    tweetsList = (RecyclerView) mainView.findViewById(R.id.tweets_list);

    tweetsList.setHasFixedSize(true);

    // use a linear layout manager
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
    tweetsList.setLayoutManager(mLayoutManager);

    GetTweetsFromDB task =
        new GetTweetsFromDB(
            getActivity(), new Cities(mCityName), new Categories(mCategoryName), this);
    task.execute();
    mTweetses = new ArrayList<>();
    adapter = new TweeetsAdapter(mTweetses, getActivity());
    tweetsList.setAdapter(adapter);

    return mainView;
  }
Beispiel #5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_favorites);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    Log.e("HudlU", "Here");

    mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view_favorites);

    mRecyclerView.setHasFixedSize(true);

    mLayoutManager = new LinearLayoutManager(this);
    mRecyclerView.setLayoutManager(mLayoutManager);

    FavoriteUtil util = new FavoriteUtil();
    myFavorites = util.getAllFavorites(this);

    FavoriteAdapter adapter = new FavoriteAdapter(this, myFavorites);
    mRecyclerView.setAdapter(adapter);

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                .setAction("Action", null)
                .show();
          }
        });
  }
  @Override
  protected void setupLayout() {
    mLayoutManager = new GridLayoutManager(getActivity(), 2);
    mAdapter = new ProductListAdapter(getActivity(), null);

    mRecyclerView.setHasFixedSize(true);
    mRecyclerView.addItemDecoration(new MarginDecoration(getActivity()));
    mRecyclerView.setLayoutManager(mLayoutManager);
    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.addOnItemTouchListener(
        new RecyclerItemClickListener(
            getActivity(),
            new RecyclerItemClickListener.OnItemClickListener() {
              @Override
              public void onItemClick(View view, int position) {
                manager.currentProductDetailed = manager.productList.get(position);
                ((BaseActivity_NavDrawer) getActivity())
                    .navigator.openNewActivity(getActivity(), new ProductDetailActivity());
                Log.d("CLICK", "Clicked on item" + position);
              }
            }));

    mSwipeRefreshLayout.setColorSchemeResources(R.color.app_primary, R.color.signal_green);
    mSwipeRefreshLayout.setOnRefreshListener(
        new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
            makeAPICall();
          }
        });

    makeAPICall();
  }
Beispiel #7
0
 private void initView() {
   mMovieList.setLayoutManager(new LinearLayoutManager(getActivity()));
   mMovieList.setHasFixedSize(true);
   mAdapter = new MovieAdapter(getActivity());
   mMovieList.setAdapter(mAdapter);
   //        mAdapter.attachToRecyclerView(mMovieList);
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
    Bus bus = ((ApplicationModified) getActivity().getApplication()).getBus();
    bus.register(this);

    View myFragment = inflater.inflate(R.layout.fragment_main, container, false);
    recList = (RecyclerView) myFragment.findViewById(R.id.card_list);
    recList.setHasFixedSize(true);
    LinearLayoutManager llm = new LinearLayoutManager(this.getActivity());
    llm.setOrientation(LinearLayoutManager.VERTICAL);
    recList.setLayoutManager(llm);
    View.OnClickListener listener =
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            String title = ((TextView) v.findViewById(R.id.title)).getText().toString();
            ((BaseActivity) getActivity()).openArticle(title);
          }
        };
    ArticlesAdapter articlesAdapter;
    if (articlesList == null) {
      articlesAdapter = new ArticlesAdapter(listener);
      new ServiceHelper().getSavedArticles(this.getActivity());
    } else {
      articlesAdapter = new ArticlesAdapter(listener, articlesList);
    }
    recList.setAdapter(articlesAdapter);
    if (noResults) {
      TextView no_Results = (TextView) myFragment.findViewById(R.id.NoResultMessage);
      no_Results.setVisibility(View.VISIBLE);
    }

    return myFragment;
  }
Beispiel #9
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AppController.getController().getBus().register(this);
   manager = new GridLayoutManager(this, getResources().getInteger(R.integer.num_row));
   recycler.setItemAnimator(new DefaultItemAnimator());
   recycler.setHasFixedSize(true);
   recycler.setLayoutManager(manager);
   mDrawerLayout.setStatusBarBackgroundColor(
       AppHelper.getPrimaryDarkColor(AppHelper.getPrimaryColor(this)));
   navigationView.setItemIconTintList(ColorStateList.valueOf(AppHelper.getAccentColor(this)));
   if (AppHelper.isDarkTheme(this)) {
     navigationView.setItemTextColor(ColorStateList.valueOf(AppHelper.getAccentColor(this)));
   }
   adapter = new AppsAdapter(this, new ArrayList<AppsModel>());
   recycler.setAdapter(adapter);
   mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
   if (navigationView != null) {
     setupDrawerContent(navigationView);
   }
   getLoaderManager().restartLoader(0, null, this);
   productsList.addAll(Arrays.asList(getResources().getStringArray(R.array.in_app_billing)));
   mHelper = new IabHelper(this, getString(R.string.base64));
   mHelper.startSetup(mPurchaseFinishedListener);
   showWhatsNew();
   countBackup();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
    setSupportActionBar(mToolbar);

    mNavigationDrawerFragment =
        (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.fragment_drawer);

    // Set up the drawer.
    mNavigationDrawerFragment.setup(
        R.id.fragment_drawer, (DrawerLayout) findViewById(R.id.drawerMain), mToolbar);
    // populate the navigation drawer
    mNavigationDrawerFragment.setUserData(
        "John Doe",
        "*****@*****.**",
        BitmapFactory.decodeResource(getResources(), R.drawable.avatar));

    tagArrayList = new ArrayList<>(); // create list of tag
    populateTagArrayList(); // initialize tagList with values
    mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view_main_act); // create recyclerView
    mRecyclerView.setHasFixedSize(true);

    mLayoutManager = new LinearLayoutManager(this); // set Layout to be LinearLayout type
    mRecyclerView.setLayoutManager(
        mLayoutManager); // set Layout inside each card to be linearLayout
    mAdapter =
        new NewsfeedCardAdapter(
            tagArrayList,
            MainActivity.this); // create Card Adapter and its display to be in this page
    mRecyclerView.setAdapter(mAdapter); // set RecyclerView with the above cardAdapter
  }
Beispiel #11
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_list);

    mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.mSwipeRefreshLayout);
    mRecyclerView = (RecyclerView) findViewById(R.id.mRecyclerView);

    mLLManager = new LinearLayoutManager(getApplicationContext());
    mAdapter = new MyRecyclerAdapter(this, mCatList, R.layout.list_item_row);
    mRecyclerView.setLayoutManager(mLLManager);
    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.setHasFixedSize(true);

    getData();

    mSwipeRefreshLayout.setOnRefreshListener(
        new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
            mCatList.clear();
            getData();
          }
        });
  }
Beispiel #12
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    initSortSpinner();
    mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
    mRecyclerView.setHasFixedSize(true);
    mLayoutManager = new LinearLayoutManager(this);
    mRecyclerView.setLayoutManager(mLayoutManager);
    mAdapter = new MyRecyclerViewAdapter(getDataSet());
    // mAdapter.setOnItemClickListener(this);
    mRecyclerView.setAdapter(mAdapter);
    RecyclerView.ItemDecoration itemDecoration =
        new DividerItemDecoration(this, LinearLayoutManager.VERTICAL);
    mRecyclerView.addItemDecoration(itemDecoration);

    createEvent = (FloatingActionButton) findViewById(R.id.fab2);
    createEvent.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent i = new Intent(MainActivity.this, New_Activity_A.class);
            startActivity(i);
          }
        });

    init();
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayShowHomeEnabled(true);
    View rootView = inflater.inflate(R.layout.fragment_weapon_list, container, false);
    RecyclerView recyclerView = (RecyclerView) rootView.findViewById(R.id.listview_landing_menu);
    recyclerView.setAdapter(new LandingMenuAdapter(getActivity()));
    recyclerView.setHasFixedSize(true);
    ItemClickSupport.addTo(recyclerView)
        .setOnItemClickListener(
            new ItemClickSupport.OnItemClickListener() {
              @Override
              public void onItemClicked(RecyclerView recyclerView, int position, View v) {
                Log.e("Listener", "anda");
              }
            });
    final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);

    recyclerView.setLayoutManager(layoutManager);

    return rootView;
  }
  private void initializeUserRecyclerView() {
    mUserResourceAdapter = new SelectableResourceListAdapter(mResourceList);

    mUserListContainer.setVisibility(View.VISIBLE);
    mExpandCollapseUsers.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            if (mUsersRecyclerView.getVisibility() == View.VISIBLE) {
              mUsersRecyclerView.setVisibility(View.GONE);
              mExpandCollapseUsers.setImageResource(R.drawable.nav_next);
            } else {
              mUsersRecyclerView.setVisibility(View.VISIBLE);
              mExpandCollapseUsers.setImageResource(R.drawable.arrow_down);
            }
          }
        });

    mUsersRecyclerView.setVisibility(View.VISIBLE);
    mUsersRecyclerView.setHasFixedSize(true);
    mUsersRecyclerView.addItemDecoration(
        new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST));
    mUsersRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mUsersRecyclerView.setItemAnimator(new DefaultItemAnimator());
    mUsersRecyclerView.setAdapter(mUserResourceAdapter);
  }
Beispiel #15
0
  @Nullable
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.dap_wallet_asset_user_main_fragment, container, false);
    assetsView = (RecyclerView) rootView.findViewById(R.id.assets);
    assetsView.setHasFixedSize(true);
    assetImageDetail = (ImageView) rootView.findViewById(R.id.asset_image);

    if (asset.getImage() != null) {
      assetImageDetail.setImageBitmap(
          BitmapFactory.decodeStream(new ByteArrayInputStream(asset.getImage())));
    } else {
      assetImageDetail.setImageDrawable(
          rootView.getResources().getDrawable(R.drawable.img_asset_without_image));
    }

    layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
    assetsView.setLayoutManager(layoutManager);
    adapter = new DigitalAssetAdapter(getActivity());
    adapter.setPopupMenu(
        new com.bitdubai.fermat_dap_android_wallet_asset_user_bitdubai.interfaces.PopupMenu() {
          @Override
          public void onMenuItemClickListener(View menuView, DigitalAsset project, int position) {
            setAsset(project);
            PopupMenu popupMenu = new PopupMenu(getActivity(), menuView);
            MenuInflater inflater = popupMenu.getMenuInflater();
            inflater.inflate(R.menu.dap_wallet_asset_user_main, popupMenu.getMenu());
            popupMenu.setOnMenuItemClickListener(MainFragment.this);
            popupMenu.show();
          }
        });
    assetsView.setAdapter(adapter);
    return rootView;
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    List<String> list = new ArrayList<>(5);
    list.add(
        "在很多时候xml里面的布局并不能满足我们的需求。这时候就需要用代码进行动态布局,前些天在对RelativeLayout 进行动态布局时遇到了些问题,现在解决了,分享下。");
    list.add("人生自古谁无死,留取丹心照汗青");
    list.add("我们经常会遇到让控件或是view实现叠加的效果,一般...不如RelativeLayout。");
    list.add(
        "private RecyclerView recyclerView;在很多时候xml里面的布局并不能满足我们的需求。这时候就需要用代码进行动态布局,前些天在对RelativeLayout 进行动态布局时遇到了些问题,现在解决了,分享下。");

    recyclerView = (RecyclerView) findViewById(R.id.v_recyclerView);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    adapter =
        new TVListAdapter(
            list,
            new OnItemClickForRecycler() {
              @Override
              public void onItemClick(View v, int position) {
                //                L.i(list.get(position));
              }
            });
    recyclerView.setAdapter(adapter);
    adapter.notifyDataSetChanged();
  }
Beispiel #17
0
 @Override
 public View onCreateView(
     LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   // Inflate the layout for this fragment
   final View rootView = inflater.inflate(R.layout.fragment_match_request, container, false);
   sessionManager = new SessionManager(getActivity().getApplicationContext());
   noRecordsText = (TextView) rootView.findViewById(R.id.noRecordsFound);
   swipeRefreshLayout =
       (SwipeRefreshLayout) rootView.findViewById(R.id.matched_request_swipelayout);
   swipeRefreshLayout.setColorSchemeColors(Color.RED, Color.BLUE, Color.GREEN);
   swipeRefreshLayout.setOnRefreshListener(
       new SwipeRefreshLayout.OnRefreshListener() {
         @Override
         public void onRefresh() {
           getMatchedRequest();
         }
       });
   mRecyclerView = (RecyclerView) rootView.findViewById(R.id.matched_request_recycler_view);
   mRecyclerView.setHasFixedSize(true);
   mLayoutManager = new LinearLayoutManager(rootView.getContext());
   mRecyclerView.setLayoutManager(mLayoutManager);
   mAdapter = new RowAdapterCardWithIcon(new ArrayList<CardObject>(), false);
   mRecyclerView.setAdapter(mAdapter);
   getMatchedRequest();
   return rootView;
 }
  @Override
  protected void initView(@Nullable Bundle savedInstanceState) {
    setContentView(R.layout.activity_comment_list);
    ButterKnife.bind(this);

    mToolbar.setTitleTextColor(Color.WHITE);
    setSupportActionBar(mToolbar);
    mToolbar.setTitle("评论");
    mToolbar.setNavigationIcon(R.drawable.ic_actionbar_back);

    mRecyclerView.setHasFixedSize(false);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

    mSwipeRefreshLayout.setColorSchemeResources(
        android.R.color.holo_blue_bright,
        android.R.color.holo_green_light,
        android.R.color.holo_orange_light,
        android.R.color.holo_red_light);

    mSwipeRefreshLayout.setOnRefreshListener(
        () -> {
          if (isFromFreshNews) {
            mAdapter.loadData4FreshNews();
          } else {
            mAdapter.loadData();
          }
        });
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    rootView = inflater.inflate(R.layout.home_dap_issuer_community_fragment, container, false);
    //        initViews(rootView);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.gridView);
    recyclerView.setHasFixedSize(true);
    layoutManager = new GridLayoutManager(getActivity(), 3, LinearLayoutManager.VERTICAL, false);
    recyclerView.setLayoutManager(layoutManager);
    adapter = new IssuerCommunityAdapter(getActivity());
    adapter.setAdapterChangeListener(
        new AdapterChangeListener<ActorIssuer>() {
          @Override
          public void onDataSetChanged(List<ActorIssuer> dataSet) {
            actors = dataSet;
          }
        });
    recyclerView.setAdapter(adapter);
    swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe);
    swipeRefreshLayout.setOnRefreshListener(this);
    swipeRefreshLayout.setColorSchemeColors(Color.BLUE, Color.BLUE);

    rootView.setBackgroundColor(Color.parseColor("#000b12"));
    emptyView = (LinearLayout) rootView.findViewById(R.id.empty_view);
    swipeRefreshLayout.setRefreshing(true);
    onRefresh();

    return rootView;
  }
  private void initToggles() {
    mConfigToggles = createConfigToggles();
    RecyclerView configView = (RecyclerView) findViewById(R.id.config_recycler_view);
    configView.setAdapter(
        new RecyclerView.Adapter<ConfigViewHolder>() {
          @Override
          public ConfigViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            return new ConfigViewHolder(
                LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.config_view_toggle, parent, false));
          }

          @Override
          public void onBindViewHolder(ConfigViewHolder holder, int position) {
            ConfigToggle toggle = mConfigToggles[position];
            holder.bind(toggle);
          }

          @Override
          public int getItemCount() {
            return mConfigToggles.length;
          }
        });
    configView.setLayoutManager(
        new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
    configView.setHasFixedSize(true);
  }
Beispiel #21
0
  @Override
  public void onStart() {
    super.onStart();
    mRecyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view);
    mRecyclerView.setHasFixedSize(true);
    mLayoutManager = new LinearLayoutManager(getContext());
    mRecyclerView.setLayoutManager(mLayoutManager);
    mAdapter = new MyRecyclerViewAdapter(profileDataset());
    mRecyclerView.setAdapter(mAdapter);
    initiatizeViews();

    //        RecyclerView.ItemDecoration itemDecoration =  new DividerItemDecoration(getContext(),
    // LinearLayoutManager.VERTICAL);
    //        mRecyclerView.addItemDecoration(itemDecoration);

    // Code to Add an item with default animation
    // ((MyRecyclerViewAdapter) mAdapter).addItem(obj, index);

    // Code to remove an item with default animation
    // ((MyRecyclerViewAdapter) mAdapter).deleteItem(index);
    ((MyRecyclerViewAdapter) mAdapter)
        .setOnItemClickListener(
            new MyRecyclerViewAdapter.MyClickListener() {
              @Override
              public void onItemClick(int position, View v) {
                Log.i(LOG_TAG, " Clicked on Item " + position);
              }
            });
  }
  @Override
  public void onViewCreated(final View view, final Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mRecyclerView = (RecyclerView) view.findViewById(R.id.base_recycler_view);
    final RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
    mRecyclerView.setLayoutManager(layoutManager);
    mRecyclerView.setHasFixedSize(true);

    dataAsyncTask = new DataAsyncTask(mTarget);
    dataAsyncTask.execute();

    mRecyclerView.setAdapter(
        new RecyclerView.Adapter() {
          @Override
          public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
            return null;
          }

          @Override
          public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int i) {}

          @Override
          public int getItemCount() {
            return 0;
          }
        });
    MaterialViewPagerHelper.registerRecyclerView(getActivity(), mRecyclerView, null);
  }
  private void initRecyclerViewCard() {

    mRecyclerView = (RecyclerView) v.findViewById(R.id.my_recycler_view_cardView);
    mLayoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
    mRecyclerView.setHasFixedSize(true);
    mRecyclerView.setLayoutManager(mLayoutManager);
    mAdapter = new MyRecyclerViewAdapterCardView(myDataset);
    mRecyclerView.setAdapter(mAdapter);

    // Code to Add an item with default animation
    // ((MyRecyclerViewAdapter) mAdapter).addItem(obj, index);

    // Code to remove an item with default animation
    // ((MyRecyclerViewAdapter) mAdapter).deleteItem(index);
    ((MyRecyclerViewAdapterCardView) mAdapter)
        .setOnItemClickListener(
            new MyRecyclerViewAdapterCardView.MyClickListener() {
              @Override
              public void onItemClick(int position, View v) {
                ArrayList<String> temp = mLstOrders.get(position);
                intent.putStringArrayListExtra("dish", temp);
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
              }
            });
  }
Beispiel #24
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View layout = inflater.inflate(R.layout.fragment_navigation_drawer, container, false);
    recyclerView = (RecyclerView) layout.findViewById(R.id.drawerList);
    adapter = new NavigationDrawerAdapter(getActivity(), ((MainActivity) getActivity()).getData());
    recyclerView.setHasFixedSize(true);
    recyclerView.setAdapter(adapter);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.addOnItemTouchListener(
        new RecyclerTouchListener(
            getActivity(),
            recyclerView,
            new ClickListener() {

              @Override
              public void onClick(View view, final int position) {
                if ((position + 1) > ManagerFragmentId.playlistFragment()
                    && (position + 1) < ManagerFragmentId.settingFragment()) return;
                if ((position + 1) != ManagerFragmentId.settingFragment()) {
                  adapter.selectPosition(position);
                }
                drawerListener.onDrawerItemSelected(view, position);
                mDrawerLayout.closeDrawer(containerView);
              }

              @Override
              public void onLongClick(View view, int position) {}
            }));
    return layout;
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tarot_feedback);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    final ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(false);

    FloatingActionButton fablogin = (FloatingActionButton) findViewById(R.id.fab_login);
    fablogin.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            if (TextUtils.isEmpty(getUsername())) {
              facebookLogin();
            } else {
              addFeedback(getUsername());
            }
          }
        });
    RecyclerView rv = (RecyclerView) findViewById(R.id.recyclerview);
    rv.setHasFixedSize(true);
    LinearLayoutManager llm = new LinearLayoutManager(this);
    llm.setOrientation(LinearLayoutManager.VERTICAL);
    rv.setLayoutManager(llm);
    updateList();
  }
  @Nullable
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.wizard_step_summary, container, false);

    mainScreen = (ImageView) rootView.findViewById(R.id.main_screenshot);
    iconScreen = (ImageView) rootView.findViewById(R.id.wallet_icon);
    name = (FermatTextView) rootView.findViewById(R.id.wallet_name);
    type = (FermatTextView) rootView.findViewById(R.id.wallet_type);
    initPlatform = (FermatTextView) rootView.findViewById(R.id.wallet_init_platform);
    finalPlatform = (FermatTextView) rootView.findViewById(R.id.wallet_final_platform);
    description = (FermatTextView) rootView.findViewById(R.id.wallet_short_description);
    video_url = (FermatTextView) rootView.findViewById(R.id.video_url);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.screenShootsRecycler);
    recyclerView.setHasFixedSize(true);

    layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
    recyclerView.setLayoutManager(layoutManager);

    adapter = new ScreenShootAdapter(getActivity());
    recyclerView.setAdapter(adapter);

    return rootView;
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    try {
      rootView =
          inflater.inflate(R.layout.aac_fragment_connections_notificactions, container, false);
      setUpScreen(inflater);
      recyclerView = (RecyclerView) rootView.findViewById(R.id.aac_recycler_view);
      layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
      recyclerView.setLayoutManager(layoutManager);
      recyclerView.setHasFixedSize(true);
      adapter = new AppNotificationAdapter(getActivity(), artistCommunityInformations);
      adapter.setFermatListEventListener(this);
      recyclerView.setAdapter(adapter);

      swipeRefresh = (SwipeRefreshLayout) rootView.findViewById(R.id.afc_swipeRefresh);
      swipeRefresh.setOnRefreshListener(this);
      swipeRefresh.setColorSchemeColors(Color.BLUE, Color.BLUE);

      rootView.setBackgroundColor(Color.parseColor("#000b12"));
      emptyView = (LinearLayout) rootView.findViewById(R.id.aac_empty_view);

      onRefresh();

    } catch (Exception ex) {
      CommonLogger.exception(TAG, ex.getMessage(), ex);
      Toast.makeText(
              getActivity().getApplicationContext(),
              "Oooops! recovering from system error",
              Toast.LENGTH_SHORT)
          .show();
    }

    return rootView;
  }
  @Nullable
  @Override
  public View onCreateView(
      LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.activity_dashboard, container, false);

    rvEvent = (RecyclerView) rootView.findViewById(R.id.rvevents);
    rvEvent = (RecyclerView) rootView.findViewById(R.id.rvHome);
    rvEvent.setHasFixedSize(true);
    rvEvent.setLayoutManager(new LinearLayoutManager(getActivity()));
    RestClient.get()
        .listEvent(
            AppConstant.API_KEY,
            new Callback<List<EventModel>>() {
              @Override
              public void success(List<EventModel> eventModels, Response response) {
                rvEvent.setAdapter(new AdapterEvents(getActivity(), eventModels));
              }

              @Override
              public void failure(RetrofitError error) {
                Toast.makeText(
                        getActivity(), "Tidak dapat mendapatkan daftar event", Toast.LENGTH_LONG)
                    .show();
              }
            });

    return rootView;
  }
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_restaurant, container, false);

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.restaurant_fragment_recycler);
    recyclerView.setHasFixedSize(true);

    recyclerView.setLayoutManager(mStaggeredGridLayoutManager);

    final RuAdapter ruAdapter = new RuAdapter(getActivity());
    recyclerView.setAdapter(ruAdapter);

    final SwipeRefreshLayout swipeRefreshLayout =
        (SwipeRefreshLayout) view.findViewById(R.id.restaurant_fragment_swipe_layout);
    swipeRefreshLayout.setOnRefreshListener(
        new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
            Log.d(AppTags.UFRGS_MOBILE, "RU Refresh");
            ruAdapter.updateAdapter();
            swipeRefreshLayout.setRefreshing(false);
          }
        });

    return view;
  }
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.recycler_activity);
    myRecyclerView = (RecyclerView) findViewById(R.id.myrecyclerview);
    myRecyclerView.setHasFixedSize(true);

    myRecyclerViewAdapter = new RecyclerViewAdapter(this);
    myRecyclerViewAdapter.setOnItemClickListener(this);
    myRecyclerView.setAdapter(myRecyclerViewAdapter);

    mLayoutManager = new GridLayoutManager(this, 2);
    myRecyclerView.setLayoutManager(mLayoutManager);

    nameField = (EditText) findViewById(R.id.namefield);
    nameField.setText(location_name);
    btnAdd = (Button) findViewById(R.id.addbutton);
    btnAdd.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            String newName = nameField.getText().toString();

            if (!newName.equals("")) {
              if (myRecyclerViewAdapter.getItemCount() > 1) {
                myRecyclerViewAdapter.add(1, newName);
                nameField.setText("");
              } else {
                myRecyclerViewAdapter.add(0, newName);
                nameField.setText("");
              }
            }
          }
        });
  }