Git Product home page Git Product logo

slider's Introduction

##中文说明

DESCRIPTION

1.Slider purpose is to make a page with sliding function

2.Slider in this version by simply extends or xml layout or added to by SliderUtils class with sliding function

Slider Slider Slider Slider

USAGE

1.Currently supported Activity, Fragment, DialogFragment,Dilaog and View.

2.By following simple operation, it may have a sliding function.

by SliderUtils.attach*

public class SampleActivity extends Activity
{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_slider);
        SliderUtils.attachActivity(this, mConfig);
    }
}

or by extends:

public class ExtendsActivity extends SliderActivity {
}

or by xml:

    <com.komi.slider.Slider
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:slider="http://schemas.android.com/apk/res-auto"
        android:id="@+id/xml_slider_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        slider:edgeOnly="false"
        slider:position="all">
        
     <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="I CAN SLIDE NOW!"
        android:textSize="23sp" />
        
        </com.komi.slider.Slider>

Note: activity of manifest need to override the configured theme: android: windowIsTranslucent, otherwise slide open the background is black.

 <style name="ActivityTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:windowIsTranslucent">true</item>
    </style>

If the device is greater than the version of android L, you can use the following method instead:

SliderUtils.attachUi(this, null);
Utils.convertActivityToTranslucent activity)

If extends SliderFragment, you need to pay attention to is: SliderFragment onCreateView function have been final overwritten, so another abstract methods to achieve creatingView and returns the layout of inflate objects.

public class ExtendsFragment extends SliderFragment
{
    @Override
    public View creatingView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_entends, container, false);
    }
}

or by SliderUtils

public class SampleFragment extends Fragment 
{  
    private ISlider iSlider;
    private View rootView;
    
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_sample, container, false);
        SliderUtils.attachFragment(this, rootView,null)
        return iSlider.getSliderView();
        }
}

DialogFragment: extends SliderDialogFragment or like this:

public class SlidabelDialogFragment extends DialogFragment
{
    protected ISlider iSlider;
    
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        iSlider = SliderUtils.attachDialog(getActivity(),getDialog(),mConfig);
    }
}

For more details, please refer to the code

DEPENDENCIES

dependencies{
    compile 'com.komi.slider:slider:0.3.2'
}

ISSUES

1.Welcome to the Issues and refine the project, if you like, please click on the star, later will expand more useful features!
2.This project extends from SwipeBackLayout and Slidr

AUTHOR

KobeKomi

slider's People

Contributors

kobekomi avatar

Watchers

James Cloos avatar Q avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.