Skip to content

Instantly share code, notes, and snippets.

View mako34's full-sized avatar
💭
automagickally

manuelBetancurt mako34

💭
automagickally
View GitHub Profile
@mako34
mako34 / editText unfocus on layout
Created September 17, 2013 04:14
android layout dont open editText
myLayout.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
myLayout.setFocusableInTouchMode(true);
@mako34
mako34 / xml positioning
Created September 17, 2013 02:05
xml UI elements positioning
//centro vertical
android:gravity="center_vertical"
@mako34
mako34 / listview example
Created September 17, 2013 01:13
ListView, creacion custom cell, en fragment
1. creo list view en xml
2. lo llamo en el fragment mi list view [inflaiter]
3. adapter custom xml
4. dapter custom CategoryAdapter.java
@mako34
mako34 / gide show UI elements
Created September 17, 2013 00:17
android, hide show elements UI
// listViewItem.setVisibility(View.VISIBLE);
listViewItem.setVisibility(View.INVISIBLE);
//setVisibility(View.GONE) on the Spinners as needed to hide them. GONE means totally gone
@mako34
mako34 / params hack programatically frame
Created September 16, 2013 23:56
Change "frame" of UI element on android
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) listViewSubItem.getLayoutParams();
params.leftMargin = 300;
//params.topMargin = 10;
listViewSubItem.setLayoutParams(params);
@mako34
mako34 / android uiElement animation
Created September 13, 2013 07:14
android animation of ui element
mAnimation = new TranslateAnimation(0, -720, 0, 0); //use size of screen!
//mAnimation = new TranslateAnimation(fromXDelta, toXDelta, fromYDelta, toYDelta)
mAnimation.setDuration(300);
mAnimation.setFillAfter(true);
mAnimation.setRepeatCount(0);
//mAnimation.setRepeatMode(Animation.REVERSE);
myUIelement.setAnimation(mAnimation);
myUIelement.startAnimation(mAnimation);
@mako34
mako34 / android fragment button listener
Created September 13, 2013 02:43
Android button listener for a fragment, note the return!
public class PhoneValidateView extends SherlockFragment{
private Button btnNewEmpresa;
private LinearLayout lLayoutFrgValidate;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
//get the layou8t
lLayoutFrgValidate=(LinearLayout) inflater.inflate(R.layout.activity_validate_phone, container, false);