Android Open Source - groundify-android Abs List View Base Activity






From Project

Back to project page groundify-android.

License

The source code is released under:

GNU General Public License

If you think the Android project groundify-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*******************************************************************************
 * Copyright 2011-2013 Sergey Tarasevich
 */* w  ww. ja  va2  s. com*/
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package deftsoft.iground.android.CustomizeListView;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.AbsListView;

import com.nostra13.universalimageloader.core.listener.PauseOnScrollListener;

import deftsoft.iground.android.R;

/**
 * 
 * 
 * @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
 */
public class AbsListViewBaseActivity extends BaseActivity {

  protected static final String STATE_PAUSE_ON_SCROLL = "STATE_PAUSE_ON_SCROLL";
  protected static final String STATE_PAUSE_ON_FLING = "STATE_PAUSE_ON_FLING";

  protected AbsListView listView;

  protected boolean pauseOnScroll = false;
  protected boolean pauseOnFling = true;

  @Override
  public void onRestoreInstanceState(Bundle savedInstanceState) {
    pauseOnScroll = savedInstanceState.getBoolean(STATE_PAUSE_ON_SCROLL,
        false);
    pauseOnFling = savedInstanceState
        .getBoolean(STATE_PAUSE_ON_FLING, true);
  }

  @Override
  public void onResume() {
    super.onResume();
    applyScrollListener();
  }

  private void applyScrollListener() {
    listView.setOnScrollListener(new PauseOnScrollListener(imageLoader,
        pauseOnScroll, pauseOnFling));
  }

  @Override
  public void onSaveInstanceState(Bundle outState) {
    outState.putBoolean(STATE_PAUSE_ON_SCROLL, pauseOnScroll);
    outState.putBoolean(STATE_PAUSE_ON_FLING, pauseOnFling);
  }

  @Override
  public boolean onPrepareOptionsMenu(Menu menu) {
    MenuItem pauseOnScrollItem = menu.findItem(R.id.item_pause_on_scroll);
    pauseOnScrollItem.setVisible(true);
    pauseOnScrollItem.setChecked(pauseOnScroll);

    MenuItem pauseOnFlingItem = menu.findItem(R.id.item_pause_on_fling);
    pauseOnFlingItem.setVisible(true);
    pauseOnFlingItem.setChecked(pauseOnFling);
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.item_pause_on_scroll:
      pauseOnScroll = !pauseOnScroll;
      item.setChecked(pauseOnScroll);
      applyScrollListener();
      return true;
    case R.id.item_pause_on_fling:
      pauseOnFling = !pauseOnFling;
      item.setChecked(pauseOnFling);
      applyScrollListener();
      return true;
    default:
      return super.onOptionsItemSelected(item);
    }
  }
}




Java Source Code List

.ConsequenceImageGridActivity.java
custom.adapter.pckg.GridAdapter.java
custom.adapter.pckg.MyAdapter.java
custom.adapter.pckg.MyLazyAdapter.java
custom.adapter.pckg.MySpinnerAdapter.java
deftsoft.android.iground.utility.Base64.java
deftsoft.android.iground.utility.ChildDetail.java
deftsoft.android.iground.utility.DatePickerFragment.java
deftsoft.android.iground.utility.DeleteChildWebResponse.java
deftsoft.android.iground.utility.GetNewCosequence.java
deftsoft.android.iground.utility.HttpUploader.java
deftsoft.android.iground.utility.ImageFilePath.java
deftsoft.android.iground.utility.SetConSeqWebServiceWebResponse.java
deftsoft.android.iground.utility.SignupDetail.java
deftsoft.android.iground.utility.TimePickerFragment.java
deftsoft.android.iground.utility.Utility.java
deftsoft.android.iground.utility.ViewConseqDetail.java
deftsoft.android.iground.utility.WebServiceLinks.java
deftsoft.android.iground.utility.WebServiceResponse.java
deftsoft.android.image.upload.Base64.java
deftsoft.android.image.upload.UploadImageToServer.java
deftsoft.iground.android.AddChildScreen.java
deftsoft.iground.android.AddConsequenceActivity.java
deftsoft.iground.android.BridgeClass.java
deftsoft.iground.android.CopyOfConsequenceImageGridActivity.java
deftsoft.iground.android.DeleteChildScreen.java
deftsoft.iground.android.GrounChild.java
deftsoft.iground.android.HomeScreenActivity.java
deftsoft.iground.android.Home.java
deftsoft.iground.android.LogInScreenActivity.java
deftsoft.iground.android.MyHttpClient.java
deftsoft.iground.android.SignUpScreenActivity.java
deftsoft.iground.android.ThankYouActivity.java
deftsoft.iground.android.UILApplication.java
deftsoft.iground.android.ViewConsequence.java
deftsoft.iground.android.CustomizeListView.AbsListViewBaseActivity.java
deftsoft.iground.android.CustomizeListView.BaseActivity.java
deftsoft.iground.android.CustomizeListView.Constants.java
iground.child.interfaces.Consequnceselected.java