AndroidPullMenu


Source link: https://shkurtia.github.io/AndroidPullMenu

AndroidPullMenu

AndroidPullMenu is an Open Source Android library that allows developers to easily create applications with pull menu. The aim of this library is to allow users that with a simple pull gesture to choose actions that they want to be executed.

This actions stand for refreshing options like refreshing the latest news, most viewed news, most commented views etc. or adding more actions inside view when you don’t want to implement these actions inside sliding menu. It can be implemented inside ScrollView, GridView, ListView.

For more information see the website: AndroidPullMenu

Simple Example:

The implementation should be easy if you have used this library: ActionBar-PullToRefresh

Java code:

public class MainActivity extends ActionBarActivity implements OnRefreshListener{
  private PullMenuLayout mPullMenuLayout;  @Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_scrollview);

// Now find the PullMenuLayout and set it up
  mPullMenuLayout = (PullMenuLayout) findViewById(R.id.pm_layout);

 ArrayList<String> mList = new ArrayList<String>();

  mList.add("Top Stories");

  mList.add("Most Recent");

  mList.add("Interest");

  mList.add("Refresh");

 // We can now setup the PullMenuLayout
  ActionBarPullMenu.from(this)

 .allChildrenArePullable()

 .listener(this)

 .setup(mPullMenuLayout,android.R.color.white,mList);
 
}
  @Override public void onRefreshStarted(View view, int position, String selectedField) {

Toast.makeText(MainActivity.this, position + " # "+selectedField, Toast.LENGTH_SHORT).show();

  /**

* Simulate Refresh with 4 seconds sleep

*/
  new AsyncTask<Void, Void, Void>() {

 @Override

protected Void doInBackground(Void... params) {

 try {

  Thread.sleep(Constants.SIMULATED_REFRESH_LENGTH);

 
}
 catch (InterruptedException e) {

  e.printStackTrace();

 
}

 return null;

}

 @Override

protected void onPostExecute(Void result) {

 super.onPostExecute(result);

 // Notify PullMenuLayout that the refresh has finished

 mPullMenuLayout.setRefreshComplete();

}

  
}
.execute();
 
}

 
}
 

XML Code:

  <al.shkurti.pullmenu.library.PullMenuLayout

 xmlns:android="http://schemas.android.com/apk/res/android"

 android:id="@+id/pm_layout"

 android:layout_width="match_parent"

 android:layout_height="match_parent">
 <ScrollView

 android:id="@+id/scrollview"

 android:layout_width="fill_parent"

 android:layout_height="fill_parent"

 android:padding="8dp"

 android:scrollbarStyle="outsideInset">

  <TextView

  android:layout_width="fill_parent"

  android:layout_height="wrap_content"

  android:text="@string/_text"/>
 </ScrollView>  </al.shkurti.pullmenu.library.PullMenuLayout> 

Sample

Android pull menu sample apk

Developed by:

  • Armando Shkurti

Credits:

Inspired by:

Opinions for this concept:

https://news.layervault.com/stories/40871-pull-menu-menu-interaction-concept

Special Thanks

@chrisbanes: https://github.com/chrisbanes/ActionBar-PullToRefresh

@jpardogo and @astuetz: https://github.com/jpardogo/PagerSlidingTabStrip\

@castorflex: https://github.com/castorflex/SmoothProgressBar

License

Feel free to use it in your Android apps and also include the license in your app. I would be grateful if you would inform me about its usage

Copyright 2015 Armando Shkurti  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. 

Resources

StrictMode is a handy feature in API Level 9 and higher, telling you where your Android application is doing things it probably should not on the main application thread.

In the spirit of StrictMode, the StrictModeEx project offers classes to help you diagnose similar sorts of problems beyond what StrictMode itself offers.

Right now, that consists of one class: StrictAdapter. This ListAdapter wrapper will log slow-running getView() calls, plus optionally give you an overall performance view on how your Adapter is doing in the code you control.

geo

Java utility methods for geohashing.

A very, very compact library that enables you to create on-demand singletons within your application and easily store them to disk. Utilizing a dead-simple API, this library makes creating singletons and persisting data much more fun!

This app is built during the free time of the developer for fun. It provides with a tool to test some Intent behavior while building and testing other apps or just for fun playing with the framework. ;) This app would not work and feel the same way if it weren't for some great Android open-source projects that were used during the development.

Material Design Example is a sample application for the new design concept made by Google, Material Design. Besides the design, we have the new APIs introduced in Android SDK Lollipop:

  • Custom theme colors
  • Circular reveal
  • Activity transitions
  • Toolbar
  • Recycler View
  • Card View

Common re-usable module repository for the convenience of Android application development.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes