Upload
dhruv-patel
View
105
Download
1
Embed Size (px)
Citation preview
SHORTIFY FOR ANDROID
BY: DHRUV PATEL
TRADITIONAL ANDROID FUNCTIONS• Complex coding
• Needs more time to implement
• APK size will be large due to huge amounts of code
SHORTIFY - FEATURES• Library for minimizing your coding work
• Has built in methods and classes which help developers to build an app quickly
• Has all of the features which are used most
1. Binding of Views
2. Binding of Resources
3. Customization of View
4. Event handlers
5. Dialogs
6. Other methods
DIFFERENCE – BINDING OF VIEWS// Basic
EditText editText = (EditText) context.findViewById(R.id.editText1);
com.example.view.CustomView customView = (com.example.view.CustomView) context.findViewById(R.id.view);
// Shortify
EditText editText = $.bind(R.id.editText1);
com.example.view.CustomView customView = $.bind(R.id.view);
DIFFERENCE – BINDING OF RESOURCES// Basic
String str = getApplicationContext().getString(R.string.app_name);
Drawable drawable = getApplicationContext().getDrawable(R.drawable.example);
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.animation1);
// Shortify
String str = $.bindStr(R.string.app_name);
Drawable drawable = $.bindDrawable(R.drawable.example);Animation animation = $.bindAnim(R.anim.animation1);
DIFFERENCE – CUSTOMIZATION OF VIEWS//Basic
TextView textView = (TextView) findViewById(R.id.textView);
textView.setText(getApplicationContext().getString(R.string.app_name));
textView.setTextColor(Color.BLUE);
textView.setTextSize(16f);
textView.setAllCaps(true);
Linkify.addLinks(textView, Linkify.ALL);
//Shortify$.id(R.id.textView).text(R.string.app_name)
.color(Color.BLUE)
.size(16)
.allcapital()
.linkify();
DIFFERENCE – EVENT HANDLERS //Basic
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
//Shortify
$.id(R.id.button).click(new Task() {
@Override
public void perform() {
}});
DIFFERENCE - DIALOGS//Simple alert dialog box
$.alertDialog("Title","Description");
//Generates and shows dialog with OK button with onClick event handlers
$.confirmDialog("Title", "Description", new Click() {
@Override
public void ok() {
}});
DIFFERENCE - DIALOGS
//Generates and shows dialog with YES and NO button with onClick event handlers
$.yesNoDialog("Title", "Description", new Agree() {
@Override
public void yes() {
}
@Override
public void no() {
}});
DIFFERENCE – OTHER METHODS//Check, if app is installed or not in device
$.checkIfAppInstalled(PKG_NAME);
//Open current or any other app page in Play store app
$.openAppInStore();
$.openAppInStore(PKG_NAME);
//Showing toast$.toast(MESSAGE);
DIFFERENCE – OTHER METHODS//Get current date and time in any format
$.time("d m y");
//Check app permission (used for Runntime Permission Model)
$.checkPermission(PERMISSION_STRING);
//Navigate to any activity with or without passing data
$.open(Activity.class);$.open(Activity.class, bundle);
CURRENTLY IN DEVELOPMENT• $.get(URL);
• $.post(URL, new Bundle());
• $.rateDialog();
• $.html(“<div><h1>Header</h1><a href=‘’>click</a></div>”);
• $.getJSON(URL, new Callback(){});
• $.parseJSON(new JSONObject());
• $.inviteFriends(“Share text”);
• And much more…
HAVE QUESTIONS?
THANK YOU