Java Code Examples for android.widget.LinearLayout

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project agit, under directory /agit/src/main/java/com/madgag/android/notifications/.

Source file: NotificationViewSearcher.java

  32 
vote

public void search(){
  LinearLayout viewParent=new LinearLayout(context);
  ViewGroup eventView=(ViewGroup)notification.contentView.apply(context,viewParent);
  search(eventView);
  viewParent.removeAllViews();
}
 

Example 2

From project Airports, under directory /src/com/nadmm/airports/aeronav/.

Source file: DtppActivity.java

  32 
vote

protected void showDtppCharts(Cursor[] result){
  LinearLayout topLayout=(LinearLayout)findViewById(R.id.dtpp_detail_layout);
  int index=3;
  while (index < result.length) {
    showChartGroup(topLayout,result[index]);
    ++index;
  }
  showOtherCharts(topLayout);
  ArrayList<String> pdfNames=new ArrayList<String>();
  for (  String pdfName : mDtppRowMap.keySet()) {
    pdfNames.add(pdfName);
  }
  checkTppCharts(pdfNames,false);
}
 

Example 3

From project android-client_2, under directory /src/org/mifos/androidclient/main/views/helpers/.

Source file: LoanAccountDetailsViewBuilder.java

  32 
vote

private void prepareRecentNotes(View view){
  TextView textView;
  textView=(TextView)view.findViewById(R.id.accountOverviewLoan_recentNotes_label);
  textView.setVisibility(View.VISIBLE);
  LinearLayout recentNotesLayout=(LinearLayout)view.findViewById(R.id.accountOverviewLoan_recentNotes);
  for (  CustomerNote accNote : mDetails.getRecentNoteDtos()) {
    textView=new TextView(mContext);
    textView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
    textView.setText(accNote.getComment() + " " + accNote.getCommentDate()+ " "+ accNote.getPersonnelName());
    recentNotesLayout.addView(textView);
  }
}
 

Example 4

From project android-shuffle, under directory /client/src/org/dodgybits/shuffle/android/editor/activity/.

Source file: TaskEditorActivity.java

  32 
vote

static ArrayList<Integer> reminderItemsToMinutes(ArrayList<LinearLayout> reminderItems,ArrayList<Integer> reminderValues){
  int len=reminderItems.size();
  ArrayList<Integer> reminderMinutes=new ArrayList<Integer>(len);
  for (int index=0; index < len; index++) {
    LinearLayout layout=reminderItems.get(index);
    Spinner spinner=(Spinner)layout.findViewById(R.id.reminder_value);
    int minutes=reminderValues.get(spinner.getSelectedItemPosition());
    reminderMinutes.add(minutes);
  }
  return reminderMinutes;
}
 

Example 5

From project Android-Simple-Social-Sharing, under directory /SimpleSocialSharing/src/com/nostra13/socialsharing/facebook/extpack/com/facebook/android/.

Source file: FbDialog.java

  32 
vote

private void setUpWebView(int margin){
  LinearLayout webViewContainer=new LinearLayout(getContext());
  mWebView=new WebView(getContext());
  mWebView.setVerticalScrollBarEnabled(false);
  mWebView.setHorizontalScrollBarEnabled(false);
  mWebView.setWebViewClient(new FbDialog.FbWebViewClient());
  mWebView.getSettings().setJavaScriptEnabled(true);
  mWebView.loadUrl(mUrl);
  mWebView.setLayoutParams(FILL);
  mWebView.setVisibility(View.INVISIBLE);
  webViewContainer.setPadding(margin,margin,margin,margin);
  webViewContainer.addView(mWebView);
  mContent.addView(webViewContainer);
}
 

Example 6

From project android-tether, under directory /facebook/src/com/facebook/android/.

Source file: FbDialog.java

  32 
vote

private void setUpWebView(int margin){
  LinearLayout webViewContainer=new LinearLayout(getContext());
  mWebView=new WebView(getContext());
  mWebView.setVerticalScrollBarEnabled(false);
  mWebView.setHorizontalScrollBarEnabled(false);
  mWebView.setWebViewClient(new FbDialog.FbWebViewClient());
  mWebView.getSettings().setJavaScriptEnabled(true);
  mWebView.loadUrl(mUrl);
  mWebView.setLayoutParams(FILL);
  mWebView.setVisibility(View.INVISIBLE);
  webViewContainer.setPadding(margin,margin,margin,margin);
  webViewContainer.addView(mWebView);
  mContent.addView(webViewContainer);
}
 

Example 7

From project Android_1, under directory /ListStyles/src/com/novoda/.

Source file: StyledListItems.java

  32 
vote

public StyledItemView(Context context,String title){
  super(context);
  this.setOrientation(VERTICAL);
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  LinearLayout layout=(LinearLayout)mInflater.inflate(R.layout.list_item,null);
  mTitle=(TextView)layout.findViewById(R.id.txt_item);
  addView(layout);
}
 

Example 8

From project 2Degrees-Toolbox, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: MenuItemImpl.java

  31 
vote

public MenuItem setActionView(int resId){
  final Context context=mMenu.getContext();
  final LayoutInflater inflater=LayoutInflater.from(context);
  setActionView(inflater.inflate(resId,new LinearLayout(context),false));
  return this;
}
 

Example 9

From project 4308Cirrus, under directory /Extras/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: MenuItemImpl.java

  31 
vote

public MenuItem setActionView(int resId){
  final Context context=mMenu.getContext();
  final LayoutInflater inflater=LayoutInflater.from(context);
  setActionView(inflater.inflate(resId,new LinearLayout(context),false));
  return this;
}
 

Example 10

From project abalone-android, under directory /src/com/bytopia/abalone/.

Source file: SelectLayoutActivity.java

  31 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  layouts=new ArrayList<Layout>();
  for (  String layout : getResources().getStringArray(R.array.game_layouts)) {
    String tempAi="com.bytopia.abalone.mechanics." + layout;
    try {
      Class layoutClass=Class.forName(tempAi);
      Layout l=(Layout)layoutClass.newInstance();
      layouts.add(l);
    }
 catch (    Exception e1) {
      e1.printStackTrace();
    }
  }
  setContentView(R.layout.layout_selecting);
  boardView=new BoardView(getApplicationContext()){
    @Override public boolean onTouchEvent(    MotionEvent e){
      if (e.getAction() == MotionEvent.ACTION_UP) {
        String name=layouts.get(index).getClass().getName();
        SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        preferences.edit().putString("layout",name).commit();
        finish();
      }
      return true;
    }
  }
;
  prev=(Button)findViewById(R.id.slect_layout_prev);
  next=(Button)findViewById(R.id.slect_layout_next);
  refrashLayout();
  LinearLayout linearLayout=(LinearLayout)findViewById(R.id.layout_selecting_layout);
  linearLayout.addView(boardView);
}
 

Example 11

From project ActionBarSherlock, under directory /library/src/com/actionbarsherlock/internal/view/menu/.

Source file: MenuItemImpl.java

  31 
vote

public MenuItem setActionView(int resId){
  final Context context=mMenu.getContext();
  final LayoutInflater inflater=LayoutInflater.from(context);
  setActionView(inflater.inflate(resId,new LinearLayout(context),false));
  return this;
}
 

Example 12

From project Alerte-voirie-android, under directory /src/net/londatiga/android/.

Source file: QuickAction.java

  31 
vote

/** 
 * Get action item  {@link View}
 * @param title action item title
 * @param icon {@link Drawable} action item icon
 * @param listener {@link View.OnClickListener} action item listener
 * @return action item {@link View}
 */
private View getActionItem(String title,Drawable icon,OnClickListener listener){
  LinearLayout container=(LinearLayout)inflater.inflate(R.layout.action_item,null);
  ImageView img=(ImageView)container.findViewById(R.id.icon);
  TextView text=(TextView)container.findViewById(R.id.title);
  if (icon != null) {
    img.setImageDrawable(icon);
  }
 else {
    img.setVisibility(View.GONE);
  }
  if (title != null) {
    text.setText(title);
  }
 else {
    text.setVisibility(View.GONE);
  }
  if (listener != null) {
    container.setOnClickListener(listener);
  }
  return container;
}
 

Example 13

From project Amantech, under directory /Android/action_bar_sherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: MenuItemImpl.java

  31 
vote

public MenuItem setActionView(int resId){
  final Context context=mMenu.getContext();
  final LayoutInflater inflater=LayoutInflater.from(context);
  setActionView(inflater.inflate(resId,new LinearLayout(context),false));
  return this;
}
 

Example 14

From project AmDroid, under directory /AmDroid/src/main/java/com/jaeckel/amenoid/.

Source file: ScoreBoardAdapter.java

  31 
vote

@Override public View getView(final int position,View convertView,ViewGroup parent){
  View row=convertView;
  RankedStatements statement=getItem(position);
  if (row == null) {
    row=inflater.inflate(R.layout.list_item_score,parent,false);
    row.setTag(R.id.objekt_name,row.findViewById(R.id.objekt_name));
    row.setTag(R.id.amen_count,row.findViewById(R.id.amen_count));
  }
  TextView nameView=(TextView)row.getTag(R.id.objekt_name);
  nameView.setTypeface(amenTypeBold);
  nameView.setText(statement.getStatement().getObjekt().getName());
  TextView countView=(TextView)row.getTag(R.id.amen_count);
  countView.setText(statement.getStatement().getTotalAmenCount() + " Amen");
  LinearLayout bar=(LinearLayout)row.findViewById(R.id.bar);
  return row;
}
 

Example 15

From project andlytics, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: MenuItemImpl.java

  31 
vote

public MenuItem setActionView(int resId){
  final Context context=mMenu.getContext();
  final LayoutInflater inflater=LayoutInflater.from(context);
  setActionView(inflater.inflate(resId,new LinearLayout(context),false));
  return this;
}
 

Example 16

From project android-bankdroid, under directory /src/net/margaritov/preference/colorpicker/.

Source file: ColorPickerPreference.java

  31 
vote

private void setPreviewColor(){
  if (mView == null)   return;
  ImageView iView=new ImageView(getContext());
  LinearLayout widgetFrameView=((LinearLayout)mView.findViewById(android.R.id.widget_frame));
  if (widgetFrameView == null)   return;
  widgetFrameView.setPadding(widgetFrameView.getPaddingLeft(),widgetFrameView.getPaddingTop(),(int)(mDensity * 8),widgetFrameView.getPaddingBottom());
  int count=widgetFrameView.getChildCount();
  if (count > 0) {
    widgetFrameView.removeViews(0,count);
  }
  widgetFrameView.setVisibility(View.VISIBLE);
  widgetFrameView.addView(iView);
  iView.setBackgroundDrawable(new AlphaPatternDrawable((int)(5 * mDensity)));
  iView.setImageBitmap(getPreviewBitmap());
}
 

Example 17

From project android-client, under directory /xwiki-android-components/src/org/xwiki/android/components/classviewer/.

Source file: ClassViewer.java

  31 
vote

private void initClassEditor(){
  setOrientation(LinearLayout.VERTICAL);
  setScrollBarStyle(LinearLayout.SCROLLBARS_INSIDE_OVERLAY);
  LinearLayout innerLayout=new LinearLayout(context);
  innerLayout.setOrientation(LinearLayout.VERTICAL);
  innerLayout.setScrollBarStyle(LinearLayout.SCROLLBARS_INSIDE_OVERLAY);
  ScrollView scrollView=new ScrollView(context);
  for (int i=0; i < classObject.properties.size(); i++) {
    TextView textViewName=new TextView(context);
    textViewName.setText(classObject.properties.get(i).getName());
    textViewName.setTextSize(textViewName.getTextSize() + 2.0f);
    textViewName.setTextColor(Color.WHITE);
    innerLayout.addView(textViewName);
    TextView textViewValue=new TextView(context);
    textViewValue.setText(classObject.properties.get(i).getType());
    innerLayout.addView(textViewValue);
  }
  scrollView.addView(innerLayout);
  addView(scrollView);
}
 

Example 18

From project android-joedayz, under directory /Proyectos/AndroidTwitter/src/com/mycompany/android/.

Source file: TwitterDialog.java

  31 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mSpinner=new ProgressDialog(getContext());
  mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
  mSpinner.setMessage("Loading...");
  mContent=new LinearLayout(getContext());
  mContent.setOrientation(LinearLayout.VERTICAL);
  setUpTitle();
  setUpWebView();
  Display display=getWindow().getWindowManager().getDefaultDisplay();
  final float scale=getContext().getResources().getDisplayMetrics().density;
  float[] dimensions=(display.getWidth() < display.getHeight()) ? DIMENSIONS_PORTRAIT : DIMENSIONS_LANDSCAPE;
  addContentView(mContent,new FrameLayout.LayoutParams((int)(dimensions[0] * scale + 0.5f),(int)(dimensions[1] * scale + 0.5f)));
}
 

Example 19

From project android-rackspacecloud, under directory /src/com/rackspacecloud/android/.

Source file: AddMoreNodesActivity.java

  31 
vote

protected void onListItemClick(ListView l,View v,int position,long id){
  if (possibleNodes != null && possibleNodes.size() > 0) {
    if (!possibleNodes.get(position).getName().equals("External Node")) {
      LinearLayout linear=(LinearLayout)findViewById(R.id.nodes_linear_layout);
      ListView serversList=(ListView)linear.findViewById(android.R.id.list);
      View row=serversList.getChildAt(position);
      CheckBox checkBox=(CheckBox)row.findViewById(R.id.add_node_checkbox);
      if (!checkBox.isChecked()) {
        checkBox.setChecked(!checkBox.isChecked());
      }
 else {
        Server server=possibleNodes.get(position);
        String[] ipAddresses=getAllIpsOfServer(server);
        Node node=getNodeFromServer(server);
        positionOfNode=findNodePosition(node);
        lastCheckedPos=position;
        Intent viewIntent=new Intent(getContext(),AddNodeActivity.class);
        viewIntent.putExtra("ipAddresses",ipAddresses);
        viewIntent.putExtra("name",server.getName());
        if (node != null) {
          viewIntent.putExtra("node",node);
        }
        viewIntent.putExtra("weighted",loadBalancer.getAlgorithm().toLowerCase().contains("weighted"));
        startActivityForResult(viewIntent,ADD_NODE_CODE);
      }
    }
 else {
      Server server=possibleNodes.get(position);
      Node node=getNodeFromServer(server);
      positionOfNode=findNodePosition(node);
      lastCheckedPos=position;
      Intent viewIntent=new Intent(getContext(),AddExternalNodeActivity.class);
      if (node != null) {
        viewIntent.putExtra("node",node);
      }
      viewIntent.putExtra("weighted",false);
      startActivityForResult(viewIntent,ADD_EXTERNAL_NODE_CODE);
    }
  }
}
 

Example 20

From project android-wheel, under directory /wheel/src/kankan/wheel/widget/.

Source file: WheelView.java

  31 
vote

/** 
 * Creates item layouts if necessary
 */
private void createItemsLayout(){
  if (itemsLayout == null) {
    itemsLayout=new LinearLayout(getContext());
    itemsLayout.setOrientation(LinearLayout.VERTICAL);
  }
}
 

Example 21

From project android-wheel-datetime-picker, under directory /src/kankan/wheel/widget/.

Source file: WheelView.java

  31 
vote

/** 
 * Creates item layouts if necessary
 */
private void createItemsLayout(){
  if (itemsLayout == null) {
    itemsLayout=new LinearLayout(getContext());
    itemsLayout.setOrientation(LinearLayout.VERTICAL);
  }
}
 

Example 22

From project android-wheel_1, under directory /wheel/src/kankan/wheel/widget/.

Source file: WheelView.java

  31 
vote

/** 
 * Creates item layouts if necessary
 */
private void createItemsLayout(){
  if (itemsLayout == null) {
    itemsLayout=new LinearLayout(getContext());
    itemsLayout.setOrientation(LinearLayout.VERTICAL);
  }
}
 

Example 23

From project AndroidLab, under directory /samples/AndroidLdapClient/src/com/unboundid/android/ldap/client/.

Source file: ViewEntry.java

  31 
vote

/** 
 * Generates the display for a generic entry.
 */
private void displayGeneric(){
  logEnter(LOG_TAG,"displayGeneric");
  setTitle("Entry " + entry.getDN());
  final LinearLayout layout=(LinearLayout)findViewById(R.id.layout_view_entry_panel);
  final HeaderClickListener hdrListener=new HeaderClickListener(this,entry);
  final LinearLayout l=new LinearLayout(this);
  l.setPadding(0,5,0,20);
  l.setOrientation(LinearLayout.VERTICAL);
  final TextView dnNameView=new TextView(this);
  dnNameView.setTextSize(TypedValue.COMPLEX_UNIT_SP,12.0f);
  dnNameView.setText(getDisplayName(this,"DN"));
  dnNameView.setGravity(Gravity.LEFT);
  dnNameView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.FILL_PARENT));
  l.addView(dnNameView);
  final TextView dnValueView=new TextView(this);
  dnValueView.setTextSize(TypedValue.COMPLEX_UNIT_SP,16.0f);
  dnValueView.setText(entry.getDN());
  dnValueView.setGravity(Gravity.RIGHT);
  dnValueView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT));
  l.addView(dnValueView);
  l.setOnClickListener(hdrListener);
  layout.addView(l);
  for (  final Attribute a : entry.getAttributes()) {
    if (a.hasValue()) {
      addGenericAttribute(a,layout);
    }
  }
}
 

Example 24

From project androidZenWriter, under directory /library/src/com/actionbarsherlock/internal/view/menu/.

Source file: MenuItemImpl.java

  31 
vote

public MenuItem setActionView(int resId){
  final Context context=mMenu.getContext();
  final LayoutInflater inflater=LayoutInflater.from(context);
  setActionView(inflater.inflate(resId,new LinearLayout(context),false));
  return this;
}
 

Example 25

From project android-marvin, under directory /marvin-it/src/test/android/de/akquinet/android/marvintest/activities/.

Source file: ActivityC.java

  30 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  View layout=new LinearLayout(this);
  layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
  layout.setId(CONTENT_VIEW_ID);
  layout.setOnKeyListener(new OnKeyListener(){
    @Override public boolean onKey(    View v,    int keyCode,    KeyEvent event){
      keyIdentifier=keyCode;
      if (event.getAction() == KeyEvent.ACTION_DOWN)       actionIdentifierDown=true;
 else       if (event.getAction() == KeyEvent.ACTION_UP)       actionIdentifierUp=true;
      return true;
    }
  }
);
  setContentView(layout);
  layout.setFocusable(true);
  layout.setFocusableInTouchMode(true);
  layout.requestFocus();
  super.onCreate(savedInstanceState);
}
 

Example 26

From project androidquery, under directory /auth/com/androidquery/.

Source file: WebDialog.java

  30 
vote

private void setupProgress(RelativeLayout layout){
  Context context=getContext();
  ll=new LinearLayout(context);
  ProgressBar progress=new ProgressBar(context);
  int p=AQUtility.dip2pixel(context,30);
  LinearLayout.LayoutParams plp=new LinearLayout.LayoutParams(p,p);
  ll.addView(progress,plp);
  if (message != null) {
    TextView tv=new TextView(context);
    LinearLayout.LayoutParams tlp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    tlp.leftMargin=AQUtility.dip2pixel(context,5);
    tlp.gravity=0x10;
    tv.setText(message);
    ll.addView(tv,tlp);
  }
  RelativeLayout.LayoutParams lp=new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  lp.addRule(RelativeLayout.CENTER_IN_PARENT);
  layout.addView(ll,lp);
}
 

Example 27

From project ActionBarCompat, under directory /ActionBarCompat/src/sk/m217/actionbarcompat/.

Source file: ActionBarHelperBase.java

  29 
vote

/** 
 * Sets up the compatibility action bar with the given title.
 */
private void setupActionBar(){
  final ViewGroup actionBarCompat=getActionBarCompat();
  if (actionBarCompat == null) {
    return;
  }
  mHomeItem=new SimpleMenuItem(new SimpleMenu(mActivity),android.R.id.home,0,mActivity.getTitle());
  final LayoutInflater inflater=LayoutInflater.from(mActivity);
  mHomeLayout=(HomeView)inflater.inflate(R.layout.actionbar_compat_home,actionBarCompat,false);
  mHomeLayout.setOnClickListener(mUpClickListener);
  mHomeLayout.setClickable(true);
  mHomeLayout.setFocusable(true);
  mExpandedHomeLayout=(HomeView)inflater.inflate(R.layout.actionbar_compat_home,actionBarCompat,false);
  mExpandedHomeLayout.setUp(true);
  mExpandedHomeLayout.setOnClickListener(mExpandedActionViewUpListener);
  mExpandedHomeLayout.setContentDescription(mActivity.getResources().getText(R.string.action_bar_up_description));
  mExpandedHomeLayout.setFocusable(true);
  ApplicationInfo appInfo=mActivity.getApplicationInfo();
  PackageManager pm=mActivity.getPackageManager();
  try {
    mIcon=pm.getActivityIcon(mActivity.getComponentName());
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"Activity component name not found!",e);
  }
  if (mIcon == null) {
    mIcon=appInfo.loadIcon(pm);
  }
  mHomeLayout.setIcon(mIcon);
  actionBarCompat.addView(mHomeLayout);
  LinearLayout.LayoutParams springLayoutParams=new LinearLayout.LayoutParams(0,ViewGroup.LayoutParams.FILL_PARENT);
  springLayoutParams.weight=1;
  mTitle=mActivity.getTitle();
  mTitleText=new TextView(mActivity,null,R.attr.actionbarCompatTitleStyle);
  mTitleText.setLayoutParams(springLayoutParams);
  mTitleText.setText(mTitle);
  actionBarCompat.addView(mTitleText);
  setDisplayOptions(DISPLAY_SHOW_HOME | DISPLAY_SHOW_TITLE);
}
 

Example 28

From project AlarmApp-Android, under directory /src/org/alarmapp/activities/.

Source file: AlarmActivity.java

  29 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  LogEx.verbose("AlarmActivity onCreate");
  this.setContentView(R.layout.alarm_confirmation);
  this.lvOperationDetails=(ListView)findViewById(R.id.lvAlarmDetails);
  this.tvTitle=(TextView)findViewById(R.id.tvTitle);
  this.tvText=(TextView)findViewById(R.id.tvText);
  this.btAccept=(Button)findViewById(R.id.btAccept);
  this.btReject=(Button)findViewById(R.id.btReject);
  this.btSwitchToStatus=(Button)findViewById(R.id.btSwitchToStatus);
  this.llButtonBar=(LinearLayout)findViewById(R.id.llButtonBar);
  this.btAccept.setOnClickListener(onUpdateAlarmStatusClick(AlarmState.Accepted));
  this.btReject.setOnClickListener(onUpdateAlarmStatusClick(AlarmState.Rejeced));
  this.btSwitchToStatus.setOnClickListener(switchToClick);
  if (AlarmData.isAlarmDataBundle(savedInstanceState)) {
    alarm=AlarmData.create(savedInstanceState);
  }
 else {
    Ensure.valid(AlarmData.isAlarmDataBundle(getIntent().getExtras()));
    alarm=AlarmData.create(getIntent().getExtras());
  }
}
 

Example 29

From project alljoyn_java, under directory /samples/android/properties/PropertiesService/src/org/alljoyn/bus/samples/properties_service/.

Source file: PropertiesService.java

  29 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  mColorSpinner=(Spinner)findViewById(R.id.color_spinner);
  ArrayAdapter<CharSequence> colorAdapter=ArrayAdapter.createFromResource(this,R.array.color_array,android.R.layout.simple_spinner_item);
  colorAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  mColorSpinner.setAdapter(colorAdapter);
  mColorSpinner.setOnItemSelectedListener(new ColorSelectedListener());
  mTextSizeSpinner=(Spinner)findViewById(R.id.text_size);
  ArrayAdapter<CharSequence> textSizeAdapter=ArrayAdapter.createFromResource(this,R.array.text_size_array,android.R.layout.simple_spinner_item);
  textSizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  mTextSizeSpinner.setAdapter(textSizeAdapter);
  mTextSizeSpinner.setOnItemSelectedListener(new TextSizeSelectedListener());
  mLoremText=(TextView)findViewById(R.id.lorem_ipsum);
  mPrimarylayout=(LinearLayout)findViewById(R.id.main_layout);
  mHandler=new UpdateUI();
  HandlerThread busThread=new HandlerThread("BusHandler");
  busThread.start();
  mBusHandler=new BusHandler(busThread.getLooper());
  mProperties=new AllJoynProperties();
  updateColor();
  updateTextSize();
  mBusHandler.sendEmptyMessage(BusHandler.CONNECT);
}
 

Example 30

From project and-bible, under directory /AndBible/src/net/bible/android/view/activity/base/.

Source file: ProgressActivityBase.java

  29 
vote

/** 
 * Wait until subclass has setContentView before looking for controls. 
 */
@Override public void onResume(){
  super.onResume();
  Log.i(TAG,"Displaying " + TAG + " view");
  progressControlContainer=(LinearLayout)findViewById(R.id.progressControlContainer);
  initialiseView();
}
 

Example 31

From project android-api-demos, under directory /src/com/mobeelizer/demos/activities/.

Source file: CreateSessionCodeActivity.java

  29 
vote

/** 
 * {@inheritDoc}
 */
@Override protected void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.a_create_session);
  mTitleBarTitle=(TextView)findViewById(R.id.titleBarTitle);
  mSessionCodeTextView=(TextView)findViewById(R.id.createSessionCode);
  mExploreButton=(Button)findViewById(R.id.createSessionExplore);
  mCreatingSessionLayout=(LinearLayout)findViewById(R.id.creatingSession);
  mSessionCreatedLayout=(LinearLayout)findViewById(R.id.sessionCreated);
  mExploreButton.setOnClickListener(getOnExploreClickListenter());
  mTitleBarTitle.setText(R.string.titleBarSessionCode);
  UIUtils.prepareClip(mExploreButton);
}
 

Example 32

From project Android-File-Manager, under directory /src/com/nexes/manager/.

Source file: EventHandler.java

  29 
vote

/** 
 * This will turn off multi-select and hide the multi-select buttons at the bottom of the view. 
 * @param clearData if this is true any files/folders the user selected for multi-selectwill be cleared. If false, the data will be kept for later use. Note: multi-select copy and move will usually be the only one to pass false,  so we can later paste it to another folder.
 */
public void killMultiSelect(boolean clearData){
  hidden_layout=(LinearLayout)((Activity)mContext).findViewById(R.id.hidden_buttons);
  hidden_layout.setVisibility(LinearLayout.GONE);
  multi_select_flag=false;
  if (positions != null && !positions.isEmpty())   positions.clear();
  if (clearData)   if (mMultiSelectData != null && !mMultiSelectData.isEmpty())   mMultiSelectData.clear();
  notifyDataSetChanged();
}
 

Example 33

From project android-flash-cards, under directory /src/org/thomasamsler/android/flashcards/activity/.

Source file: MainActivity.java

  29 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  mDataSource=new DataSource(this);
  mMainApplication=(MainApplication)getApplication();
  mMainApplication.initActionBusListener();
  mMainApplication.registerAction(this,ACTION_SHOW_CARD_SETS,ACTION_SHOW_CARDS,ACTION_SHOW_HELP,ACTION_SHOW_SETUP,ACTION_SHOW_ABOUT,ACTION_GET_EXTERNAL_CARD_SETS,ACTION_SET_HELP_CONTEXT,ACTION_SHOW_ADD_CARD,ACTION_ADD_CARD_SET,ACTION_FONT_SIZE_CHANGE,ACTION_SEND_FEEDBACK,ACTION_RESHUFFLE_CARDS);
  SharedPreferences sharedPreferences=getSharedPreferences(PREFERENCE_NAME,Context.MODE_PRIVATE);
  boolean runConversion=sharedPreferences.getBoolean(PREFERENCE_RUN_CONVERSION,PREFERENCE_RUN_CONVERSION_DEFAULT);
  if (runConversion) {
    FileToDbConversion conversion=new FileToDbConversion();
    conversion.convert(this,mDataSource);
    SharedPreferences.Editor editor=sharedPreferences.edit();
    editor.putBoolean(PREFERENCE_RUN_CONVERSION,false);
    editor.commit();
  }
  int fontSizePreference=sharedPreferences.getInt(PREFERENCE_FONT_SIZE,PREFERENCE_NORMAL_FONT_SIZE);
  mFontSize=getFontSizePreference(fontSizePreference);
  mFragmentContainer=(LinearLayout)findViewById(R.id.fragmentContainer);
  mViewPager=(ViewPager)findViewById(R.id.viewpager);
  showCardSetsFragment(false);
}
 

Example 34

From project android-pulltorefresh, under directory /library/src/com/handmark/pulltorefresh/library/.

Source file: PullToRefreshBase.java

  29 
vote

/** 
 * Updates the View State when the mode has been set. This does not do any checking that the mode is different to current state so always updates.
 */
protected void updateUIForMode(){
  if (this == mHeaderLayout.getParent()) {
    removeView(mHeaderLayout);
  }
  if (mMode.canPullDown()) {
    addViewInternal(mHeaderLayout,0,new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  }
  if (this == mFooterLayout.getParent()) {
    removeView(mFooterLayout);
  }
  if (mMode.canPullUp()) {
    addViewInternal(mFooterLayout,new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  }
  refreshLoadingViewsHeight();
  mCurrentMode=(mMode != Mode.BOTH) ? mMode : Mode.PULL_DOWN_TO_REFRESH;
}
 

Example 35

From project android-thaiime, under directory /latinime/src/com/sugree/inputmethod/latin/.

Source file: SuggestionsView.java

  29 
vote

private static void setLayoutWeight(View v,float weight,int height){
  final ViewGroup.LayoutParams lp=v.getLayoutParams();
  if (lp instanceof LinearLayout.LayoutParams) {
    final LinearLayout.LayoutParams llp=(LinearLayout.LayoutParams)lp;
    llp.weight=weight;
    llp.width=0;
    llp.height=height;
  }
}
 

Example 36

From project android-xbmcremote, under directory /src/org/xbmc/android/remote/presentation/activity/.

Source file: EpisodeDetailsActivity.java

  29 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.tvepisodedetails);
  final Display display=getWindowManager().getDefaultDisplay();
  ThumbSize.setScreenSize(display.getWidth(),display.getHeight());
  FrameLayout topFrame=(FrameLayout)findViewById(android.R.id.content);
  topFrame.setForeground(null);
  final Episode episode=(Episode)getIntent().getSerializableExtra(ListController.EXTRA_EPISODE);
  mEpisodeDetailsController=new EpisodeDetailsController(this,episode);
  ((TextView)findViewById(R.id.titlebar_text)).setText(episode.getName());
  Log.i("EpisodeDetailsActivity","rating = " + episode.rating + ", index = "+ ((int)Math.round(episode.rating % 10))+ ".");
  if (episode.rating > -1) {
    ((ImageView)findViewById(R.id.tvepisodedetails_rating_stars)).setImageResource(sStarImages[(int)Math.round(episode.rating % 10)]);
  }
  ((TextView)findViewById(R.id.tvepisodedetails_show)).setText(episode.showTitle);
  ((TextView)findViewById(R.id.tvepisodedetails_first_aired)).setText(episode.firstAired);
  ((TextView)findViewById(R.id.tvepisodedetails_director)).setText(episode.director);
  ((TextView)findViewById(R.id.tvepisodedetails_writer)).setText(episode.writer);
  ((TextView)findViewById(R.id.tvepisodedetails_rating)).setText(String.valueOf(episode.rating));
  mEpisodeDetailsController.setupPlayButton((Button)findViewById(R.id.tvepisodedetails_playbutton));
  mEpisodeDetailsController.loadCover(new Handler(),(ImageView)findViewById(R.id.tvepisodedetails_thumb));
  mEpisodeDetailsController.updateEpisodeDetails((TextView)findViewById(R.id.tvepisodedetails_plot),(LinearLayout)findViewById(R.id.tvepisodedetails_datalayout));
  mConfigurationManager=ConfigurationManager.getInstance(this);
}
 

Example 37

From project android-xbmcremote-sandbox, under directory /src/org/xbmc/android/remotesandbox/ui/base/.

Source file: ActionBarHelperBase.java

  29 
vote

/** 
 * Sets up the compatibility action bar with the given title.
 */
private void setupActionBar(){
  final ViewGroup actionBarCompat=getActionBarCompat();
  if (actionBarCompat == null) {
    return;
  }
  LinearLayout.LayoutParams springLayoutParams=new LinearLayout.LayoutParams(0,ViewGroup.LayoutParams.FILL_PARENT);
  springLayoutParams.weight=1;
  SimpleMenu tempMenu=new SimpleMenu(mActivity);
  SimpleMenuItem homeItem=new SimpleMenuItem(tempMenu,android.R.id.home,0,mActivity.getString(R.string.app_name));
  homeItem.setIcon(R.drawable.icon);
  addActionItemCompatFromMenuItem(homeItem);
  TextView titleText=new TextView(mActivity,null,R.attr.actionbarCompatTitleStyle);
  titleText.setLayoutParams(springLayoutParams);
  titleText.setText(mActivity.getTitle());
  actionBarCompat.addView(titleText);
}