1 /* Copyright 2016 Braden Farmer
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 package com.farmerbb.taskbar.fragment;
18 import android.os.Bundle;
19 import androidx.fragment.app.Fragment;
20 import android.view.LayoutInflater;
21 import android.view.View;
22 import android.view.ViewGroup;
23 import android.widget.ListView;
25 import com.farmerbb.taskbar.activity.SelectAppActivity;
27 public class SelectAppFragment extends Fragment {
29 private static final String ARG_SECTION_NUMBER = "section_number";
31 public SelectAppFragment() {}
33 public static SelectAppFragment newInstance(int sectionNumber) {
34 SelectAppFragment fragment = new SelectAppFragment();
36 Bundle bundle = new Bundle();
37 bundle.putInt(ARG_SECTION_NUMBER, sectionNumber);
39 fragment.setArguments(bundle);
44 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
45 SelectAppActivity activity = (SelectAppActivity) getActivity();
46 ListView appList = new ListView(activity);
47 int type = getArguments().getInt(ARG_SECTION_NUMBER);
49 appList.setAdapter(activity.getAppListAdapter(type));