Android Open Source - pulltorefresh_library_with_Indexable_listView Google Style Progress Layout

From Project

Back to project page pulltorefresh_library_with_Indexable_listView.


The source code is released under:

Apache License

If you think the Android project pulltorefresh_library_with_Indexable_listView 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 2014 Naver Business Platform Corp.
 * /*  w w w . ja  v  a  2 s  . co  m*/
 * 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
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package com.handmark.pulltorefresh.library;

import android.content.Context;
import android.content.res.TypedArray;
import android.view.ViewGroup;
import android.widget.FrameLayout;
 * Abstract class of Google style progress layout
 * You can override this class and implement specific layout, for example, {@see DefaultGoogleStyleProgressLayout}.
 * @author Wonjun Kim
public abstract class GoogleStyleProgressLayout extends FrameLayout implements IGoogleStyleProgressLayout {
  public GoogleStyleProgressLayout(Context context, TypedArray attrs){
   * Set Y position of this layout by using margin property.<br /> 
   * If you don't want to set default y position given by {@code PullToRefreshBase}, you have to this method and customize it.     
  public void setTopMargin(int height) {
    ViewGroup.LayoutParams params = getLayoutParams();
    if ( params instanceof FrameLayout.LayoutParams ) {
      ((FrameLayout.LayoutParams) params).topMargin = height;
   * Create a specific {@code LayoutParams}.<br /> 
   * Pull To Refresh will add this layout with applying this {@code LayoutParams} to the layout     
   * @return {@code LayoutParams} you implemented
  public FrameLayout.LayoutParams createLayoutParams() {
    return GoogleStyleProgressLayout.createDefaultLayoutParams(getContext());
   * Create a default specific {@code LayoutParams}.<br /> 
   * @param Context     
   * @return Default {@code LayoutParams}  
  public static FrameLayout.LayoutParams createDefaultLayoutParams(Context context) {
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    return params;

Java Source Code List