private void init() {
    ViewGroup.inflate(getContext(), R.layout.listen, this);

    drawer = (SlidingDrawer) findViewById(R.id.drawer);
    drawer.setOnDrawerOpenListener(this);
    drawer.setOnDrawerCloseListener(this);
    playButton = (ImageButton) findViewById(R.id.StreamPlayButton);
    playButton.setEnabled(false);
    playButton.setOnClickListener(this);
    streamButton = (ImageButton) findViewById(R.id.StreamShareButton);
    streamButton.setOnClickListener(this);
    streamButton.setEnabled(false);

    Button playlistButton = (Button) findViewById(R.id.StreamPlaylistButton);
    playlistButton.setOnClickListener(this);

    progressBar = (SeekBar) findViewById(R.id.StreamProgressBar);
    progressBar.setOnSeekBarChangeListener(this);
    progressBar.setEnabled(false);

    infoText = (TextView) findViewById(R.id.StreamTextView);

    lengthText = (TextView) findViewById(R.id.StreamLengthText);
    lengthText.setText("");

    attachToPlaybackService();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ViewGroup container = (ViewGroup) findViewById(R.id.Content);
    ViewGroup.inflate(this, R.layout.search, container);

    searchText = (EditText) findViewById(R.id.SearchText);
    searchText.setOnKeyListener(this);
    inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    // only will trigger it if no physical keyboard is open
    if (inputMethodManager != null) {
      inputMethodManager.showSoftInput(searchText, InputMethodManager.SHOW_IMPLICIT);
    }

    ImageButton searchButton = (ImageButton) findViewById(R.id.search_go_button);
    searchButton.setOnClickListener(this);

    endDate = new GregorianCalendar();
    startDate = (Calendar) endDate.clone();
    startDate.add(Calendar.DATE, -7);

    startDateButton = (Button) findViewById(R.id.StartDateButton);
    endDateButton = (Button) findViewById(R.id.EndDateButton);
    startDateButton.setText(dateFormat.format(startDate.getTime()));
    endDateButton.setText(dateFormat.format(endDate.getTime()));
    startDateButton.setOnClickListener(this);
    endDateButton.setOnClickListener(this);
  }
Пример #3
0
  private void initiate() {
    // TODO Auto-generated method stub
    // Get the view from login_signup.xml
    ViewGroup vg = (ViewGroup) findViewById(R.id.lldata);
    ViewGroup.inflate(LoginSignupActivity.this, R.layout.login_signup, vg);

    // connect variables with widgets
    username = (EditText) findViewById(R.id.username);
    password = (EditText) findViewById(R.id.password);
    loginbutton = (Button) findViewById(R.id.login);
    signup = (Button) findViewById(R.id.signup);
  }
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   ViewHolder viewHolder = null;
   if (convertView == null) {
     convertView = parent.inflate(mcontext, R.layout.item_recruitment_detail_work, null);
     viewHolder = new ViewHolder(convertView);
     convertView.setTag(viewHolder);
   } else {
     viewHolder = (ViewHolder) convertView.getTag();
   }
   viewHolder.setData(position);
   return convertView;
 }
Пример #5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ViewGroup vg = (ViewGroup) findViewById(R.id.content);
    ViewGroup.inflate(this, R.layout.activity_make_payment, vg);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    passengeravatar = (ImageView) findViewById(R.id.passengeravatar_makepayment);
    driveravatar = (ImageView) findViewById(R.id.driveravatar_makepayment);
    drivername = (TextView) findViewById(R.id.drivername_makepayment);
    account = (TextView) findViewById(R.id.driveraccount_makepayment);
    price = (TextView) findViewById(R.id.price_makepayment);

    byte[] avatarimage_p = User.selectSQLBlob(GlobalVariables.user_name);
    if (avatarimage_p != null) {
      Bitmap bm = BitmapFactory.decodeByteArray(avatarimage_p, 0, avatarimage_p.length);
      passengeravatar.setImageBitmap(bm);
    } else {
      passengeravatar.setImageResource(R.drawable.default_avatar);
    }

    drivername_val = getIntent().getStringExtra("drivername");
    drivername.setText(drivername_val);
    avatarimage = getIntent().getByteArrayExtra("driveravatar");
    if (avatarimage != null) {
      Bitmap bm = BitmapFactory.decodeByteArray(avatarimage, 0, avatarimage.length);
      driveravatar.setImageBitmap(bm);
    } else {
      driveravatar.setImageResource(R.drawable.default_avatar);
    }

    account_val = Vehicle.getDriverPaypal(drivername_val);
    if (account_val == null) {
      Toast.makeText(
              this, "Can not make payment. Driver did not add account info", Toast.LENGTH_SHORT)
          .show();
    } else if (account_val.equals("")) {
      Toast.makeText(
              this, "Network error. Failed to get Driver's paypal account.", Toast.LENGTH_SHORT)
          .show();
    }
    price_val = getIntent().getIntExtra("price", 0);
    account.setText(account_val);
    price.setText("$" + Integer.toString(price_val));

    Intent intent = new Intent(this, PayPalService.class);
    intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, paypalConfig);
    startService(intent);
  }
Пример #6
0
 private void setUp() {
   LayoutInflater layoutInflater = getLayoutInflater();
   mHeader = mRootView.inflate(mRootView.getContext(), setLayoutId(), mRootView);
   constructHeader(layoutInflater, (ViewGroup) mHeader);
 }