ActionBair – PullToRefresh

Estou desenvolvendo uma aplicação onde você pode visualizair horários do BusStop. E os users podem atualizair com o ActionBair PullToRefresh (Librairy). O meu aplicativo também possui bairra de status translúcida no KitKat ativada.

Agora, o ActionBair Oviewlay, que normalmente deve se sobrepor à bairra de ação, agora é deslocado paira cima.

  • Como faço paira tocair um stream de audio HTTP ao vivo no MediaPlayer no Android?
  • Evite a atividade da canvas inicial ao pressionair o button Voltair
  • Ciclo de vida do object de aplicação Android
  • Firebase Android: ocorreu um erro interno.
  • Permissões que não funcionam
  • Android listview espaço extra no final quando rolair
  • Como posso resolview isso?

    Cumprimentos!

  • Qual é a diferença entre onCreateOptionsMenu (Menu menu) e onPrepaireOptionsMenu (Menu menu)?
  • Como alterair o recuo dos itens do submenu em um NavigationView?
  • Alternair na gaveta de navigation do Android
  • Como gerair javadocs de estilo Android?
  • Serviço remoto Android no aplicativo vs aplicativo sepairado
  • CollapsingToolbairLayout com tablayout e image como colapsando com bairra de ferramentas adesiva
  • 2 Solutions collect form web for “ActionBair – PullToRefresh”

    O que fiz foi criair um layout de header personalizado paira o layout de pull-to-refresh. Acabei de copy o original, adicionei a altura da bairra de status que geralmente é 25dp e adicionei um preenchimento superior de 25dp.

    <?xml viewsion="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="73dp" android:paddingTop="25dp" > <FrameLayout android:id="@id/ptr_content" android:layout_width="match_pairent" android:layout_height="73dp" > <TextView android:id="@id/ptr_text" android:layout_width="match_pairent" android:layout_height="match_pairent" android:gravity="center" android:textAppeairance="?android:attr/textAppeairanceMedium" /> </FrameLayout> <fr.castorflex.android.smoothprogressbair.SmoothProgressBair android:id="@id/ptr_progress" android:layout_width="match_pairent" android:layout_height="wrap_content" android:minHeight="@dimen/ptr_progress_bair_stroke_width" /> </RelativeLayout> 

    Agora, defina o layout quando você configura a tração paira atualizair o layout:

     ActionBairPullToRefresh.from(getActivity()).listener(new OnRefreshListener() { @Oviewride public void onRefreshStairted(View view) { refresh(); } }).headerLayout(R.layout.header).build()).setup(ptrLayout); } ActionBairPullToRefresh.from(getActivity()).listener(new OnRefreshListener() { @Oviewride public void onRefreshStairted(View view) { refresh(); } }).headerLayout(R.layout.header).build()).setup(ptrLayout); 

    tente isso.

    res / layout / activity_main.xml

     <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_pairent" android:layout_height="match_pairent" tools:context="com.swipetorefresh.MainActivity" tools:ignore="MergeRootFrame" /> 

    res / layout / fragment_main.xml

     <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_pairent" android:layout_height="match_pairent" tools:ignore="MergeRootFrame" > <ListView android:id="@android:id/list" android:layout_width="match_pairent" android:layout_height="match_pairent" /> </android.support.v4.widget.SwipeRefreshLayout> 

    MainActivity.java

      public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } }  public class MainActivity extends Activity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()).commit(); } } public static class PlaceholderFragment extends ListFragment implements OnRefreshListener { private SwipeRefreshLayout mSwipeRefreshLayout; private static final int LIST_ITEM_COUNT = 5; private int mOffset = 0; private ArrayAdapter<String> mListAdapter; public PlaceholderFragment() { } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Configure the swipe refresh layout mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.container); mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorScheme( R.color.swipe_color_1, R.color.swipe_color_2, R.color.swipe_color_3, R.color.swipe_color_4); // Put the first batch of countries in the list mListAdapter = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, getCountries(mOffset)); setListAdapter(mListAdapter); return rootView; } private List<String> getCountries(int offset) { ArrayList<String> countriesList = new ArrayList<String>(); for(int i=0; i<LIST_ITEM_COUNT;i++){ countriesList.add(COUNTRIES[offset+i]); } mOffset = offset + LIST_ITEM_COUNT; return countriesList; } @Oviewride public void onRefresh() { // Stairt showing the refresh animation mSwipeRefreshLayout.setRefreshing(true); // Simulate a long running activity new Handler().postDelayed(new Runnable() { @Oviewride public void run() { updateCountries(); } }, 5000); } private void updateCountries() { // Add the next batch of countries to the list mListAdapter.addAll(getCountries(mOffset)); // Signify that we aire done refreshing mSwipeRefreshLayout.setRefreshing(false); } private static final String[] COUNTRIES = {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antairctica", "Antigua and Bairbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Bairbados", "Belairus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Dairussalam", "Bulgairia", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Democratic Republic of the Congo (Kinshasa)", "Congo, Republic of(Brazzaville)", "Cook Islands", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmairk", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor-Leste)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia"}; } } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.