@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    UmengUpdateAgent.setDefault();
    UmengUpdateAgent.update(this);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    mDrawerLayout = (ViewGroup) findViewById(R.id.drawer_layout);
    mNavigationDrawerFragment =
        (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.left_drawer);
    mTitle = getTitle();

    mFavoriteTabTitles = getResources().getStringArray(R.array.v2ex_favorite_tab_titles);
    mFavoriteTabPaths = getResources().getStringArray(R.array.v2ex_favorite_tab_paths);
    mMainTitles = getResources().getStringArray(R.array.v2ex_nav_main_titles);

    mSpinnerAdapter = new SpinnerAdapter(this, mFavoriteTabTitles);

    ActionBar supportActionBar = getSupportActionBar();
    supportActionBar.setCustomView(R.layout.actionbar_custom_spinner);
    mActionbarCustom = supportActionBar.getCustomView();
    Spinner spinner = (Spinner) supportActionBar.getCustomView().findViewById(R.id.spinner);
    spinner.setAdapter(mSpinnerAdapter);
    //        spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
    //            @Override
    //            public void onItemSelected(AdapterView<?> parent, View view, int position, long
    // id) {
    //                TopicsFragment fragment = new TopicsFragment();
    //                Bundle bundle = new Bundle();
    //                mSpinnerAdapter.setCheckPos(position);
    //                bundle.putString("tab", mFavoriteTabPaths[position]);
    //                bundle.putBoolean("attach_main", true);
    //                bundle.putBoolean("show_menu", false);
    //                fragment.setArguments(bundle);
    //
    //                FragmentTransaction fragmentTransaction =
    // getFragmentManager().beginTransaction();
    //                fragmentTransaction.replace(R.id.container, fragment,
    // mFavoriteTabTitles[position]).commit();
    //            }
    //
    //            @Override
    //            public void onNothingSelected(AdapterView<?> parent) {
    //
    //            }
    //        });

    // Set up the drawer.
    mNavigationDrawerFragment.setUp(
        R.id.left_drawer, (DrawerLayout) findViewById(R.id.drawer_layout));

    // ActionBar actionBar = getSupportActionBar();
    // actionBar.setDisplayHomeAsUpEnabled(true);
    // actionBar.setHomeButtonEnabled(true);
    // actionBar.setDisplayShowTitleEnabled(true);

    if (mIsLogin) initAccount();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    activateToolbar();

    mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

    flickrRecyclerViewAdapter =
        new FlickrRecyclerViewAdapter(MainActivity.this, new ArrayList<Photo>());
    mRecyclerView.setAdapter(flickrRecyclerViewAdapter);
    mRecyclerView.addOnItemTouchListener(
        new RecyclerItemClickListener(
            this,
            mRecyclerView,
            new RecyclerItemClickListener.OnItemClickListener() {
              @Override
              public void onItemClick(View view, int position) {
                Toast.makeText(MainActivity.this, "Normal tap", Toast.LENGTH_SHORT).show();
              }

              @Override
              public void onItemLongClick(View view, int position) {
                //                Toast.makeText(MainActivity.this, "Long tap",
                // Toast.LENGTH_SHORT).show();
                Intent intent = new Intent(MainActivity.this, ViewPhotoDetailsActivity.class);

                // additional data to be sent to and accessed by next activity
                intent.putExtra(PHOTO_TRANSFER, flickrRecyclerViewAdapter.getPhoto(position));
                startActivity(intent);
              }
            }));
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_user_profile);
   setupUserProfileGrid();
   setupRevealBackground(savedInstanceState);
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_new_point);

    if (datasetsColors == null) datasetsColors = new HashMap<String, Integer>();
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tarot_feedback);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    final ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(false);

    FloatingActionButton fablogin = (FloatingActionButton) findViewById(R.id.fab_login);
    fablogin.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            if (TextUtils.isEmpty(getUsername())) {
              facebookLogin();
            } else {
              addFeedback(getUsername());
            }
          }
        });
    RecyclerView rv = (RecyclerView) findViewById(R.id.recyclerview);
    rv.setHasFixedSize(true);
    LinearLayoutManager llm = new LinearLayoutManager(this);
    llm.setOrientation(LinearLayoutManager.VERTICAL);
    rv.setLayoutManager(llm);
    updateList();
  }
Exemple #6
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.acty_about);
   initData();
   initLayout();
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.music_play);
    bindService(
        new Intent(IMusicPlayService.class.getName()), mMusicSerConn, Context.BIND_AUTO_CREATE);
    mArtistTextView = (TextView) findViewById(R.id.artist);
    mTitleTextView = (TextView) findViewById(R.id.musictitle);
    mMusicProgress = (SeekBar) findViewById(R.id.musicprogress);
    mDuration = (TextView) findViewById(R.id.totaltime);
    mNowPosition = (TextView) findViewById(R.id.nowposition);
    mStatusButton = (ImageButton) findViewById(R.id.pause_play);
    mShuffle = (ImageButton) findViewById(R.id.shuffle);
    mRepeat = (ImageButton) findViewById(R.id.repeat);
    mMusicImg = (ImageView) findViewById(R.id.musicimg);
    mPostButton = (ImageButton) findViewById(R.id.post);

    IntentFilter filter = new IntentFilter();
    filter.addAction("statuschanged");
    registerReceiver(mReceiver, filter);
    Message msg = new Message();
    msg.what = 0;
    handler.sendMessageDelayed(msg, 100);
    Thread currentProgress = new Thread(this);
    currentProgress.start();

    setMusicImg();
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   overridePendingTransition(0, 0);
   height = Util.device_height;
   ParticipantList = Util.ParticipantList;
   setActivityTheme();
   setContentView(R.layout.idpage);
   message = this.getIntent().getExtras().getString("SCAN_RESULT");
   temp = message.split("\n");
   alanlaraAyikla();
   setUpViews();
   tabAktif();
   int size = ParticipantList.size();
   int i;
   for (i = 0; i < size; i++) {
     if (ParticipantList.get(i).equals(message)) {
       break;
     }
   }
   if (i == size) {
     Util.addParticipantToList(this, message);
   }
 }
Exemple #9
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_set_updateinfo);
   initView();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_seachstore);
    Intent intent = getIntent();
    tag = intent.getStringExtra("searchcontent");
    mListView = (PullToRefreshListView) findViewById(R.id.shopping_list);
    mListView.setOnRefreshListener(RefreshListener);

    mListView.setOnItemClickListener(mItemClickListener);

    mAdapter = new ShareListAdapter(this);
    tv_title = (TextView) findViewById(R.id.tv_title);
    tv_title.setText(R.string.microshare);
    findViewById(R.id.cb_near).setVisibility(View.GONE);
    img = (ImageView) findViewById(R.id.searchNothing);
    btn_back = (ImageButton) findViewById(R.id.btn_back);
    btn_back.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            finish();
          }
        });

    tag = getIntent().getStringExtra("searchcontent");
    loaddata();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.thirdpartyaccount);

    Bundle bundle = this.getIntent().getExtras();

    startURL = bundle.getString("starturl");
    succURL = bundle.getString("succurl");
    title = bundle.getString("title");
    followStr = bundle.getString("followStr");

    headers.put("x-365rili-key", new MyAccountManager(this).getAccount().getToken());
    if (bundle.containsKey("follow")) {
      show = bundle.getBoolean("follow");
    } else {
      show = false;
    }

    initUI();

    initData();

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

    channel = appSession.getConfigValue("Channel", "");
    setContentView(R.layout.activity_loading);
  }
  /** {@inheritDoc} */
  @Override
  protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.a_list_with_buttons);
    initTitleBarViews();
    setTitleBarTitle(R.string.titleBarSimpleSync);

    mAddButton = (Button) findViewById(R.id.footerAdd);
    mSyncButton = (Button) findViewById(R.id.footerSync);
    mInfoButton = (ImageButton) findViewById(R.id.footerInfo);
    mList = (ListView) findViewById(android.R.id.list);

    mAddButton.setOnClickListener(getOnAddClickListener());
    mSyncButton.setOnClickListener(getOnSyncClickListener());
    mInfoButton.setOnClickListener(getOnInfoClickListener());

    // clip the add button drawable
    UIUtils.prepareClip(mAddButton);
    // clip the sync button drawable
    UIUtils.prepareClip(mSyncButton);

    boolean initialized = mSharedPrefs.getBoolean(this.getClass().getSimpleName(), false);

    List<SimpleSyncEntity> data = Mobeelizer.getDatabase().list(SimpleSyncEntity.class);
    if (!initialized) {
      showDialog(D_SIMPLE_SYNC);
      mSharedPrefs.edit().putBoolean(this.getClass().getSimpleName(), true).commit();
    }

    mAdapter = new SimpleSyncAdapter(this, data);
    mAdapter.sort(new SimpleSyncEntity());
    mList.setAdapter(mAdapter);
  }
  @Override
  public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
    super.onCreate(savedInstanceState, persistentState);
    setContentView(R.layout.activity_add_coupon);

    isGreaterThanKITKAT();

    ButterKnife.inject(this);

    presenter = new AddCouponPresenter(this, this);

    binding.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            if (StringUtils.isBlank(coupon_number.getText().toString())) {
              ToastUtil.showMessage(AddCouponActivity.this, "ÇëÊäÈëÓÅ»ÝȯºÅ");
              return;
            }
            if (StringUtils.isBlank(coupon_password.getText().toString())) {
              ToastUtil.showMessage(AddCouponActivity.this, "ÇëÊäÈëÓÅ»ÝȯÃÜÂë");
              return;
            }
            presenter.binding(
                coupon_number.getText().toString(), coupon_password.getText().toString());
          }
        });
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.wallchanger);
   mProgressBar = (ProgressBar) findViewById(R.id.progress_progress);
   mProgressPanel = findViewById(R.id.progress_progress);
   mProgressLabel = (TextView) findViewById(R.id.progress_label);
   mProgressCancel = (Button) findViewById(R.id.progress_cancel);
   if (isGTV()) {
     showToast("Welcome, GoogleTV user!");
   }
   if (true) getActionBar().hide();
   else findViewById(R.id.title_frame).setVisibility(View.GONE);
   MediaUtils.init(getApplicationContext());
   try {
     if (!MediaUtils.writeFile("pewp", new byte[] {}, true))
       Logger.LogWarning("Unable to write to pewp");
     else Logger.LogInfo("Wrote to pewp!");
   } catch (IOException fnfe) {
     Logger.LogError("Unable to write to pewp!", fnfe);
   }
   mUseMultiplePanes = (null != findViewById(R.id.detail_container));
   if (null == savedInstanceState) {
     FragmentManager fm = getSupportFragmentManager();
     FragmentTransaction ft = fm.beginTransaction();
     mFragHash.put("list", new ProfileMakerList());
     ft.replace(R.id.list, mFragHash.get("list"), "list");
     ft.commit();
     ShowDetailFragment(new PreviewFragment(), "preview");
     ShowPreview(((BitmapDrawable) getWallpaper()).getBitmap());
   }
 }
Exemple #16
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_tracking);
   ButterKnife.bind(this);
   initActionBar("Tracking");
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_nonstandar_add);
    setBack();
    setTitleText("商品添加");
    mTvTitleRight = (TextView) findViewById(R.id.right_text);
    mTvTitleRight.setText("发布");
    mTvTitleRight.setTextColor(getResources().getColor(R.color.main_red));
    mTvTitleRight.setOnClickListener(this);

    mEtCash = (EditText) findViewById(R.id.e_cash);
    mEtPrice = (EditText) findViewById(R.id.price);
    mEtMarketPrice = (EditText) findViewById(R.id.market_price);
    mEtName = (EditText) findViewById(R.id.name);
    mEtDec = (EditText) findViewById(R.id.dec);
    mEtUtit = (EditText) findViewById(R.id.unit);
    mEtTitle = (EditText) findViewById(R.id.sort_title);

    mGridView = (NoScrollGridView) findViewById(R.id.gridview);

    mList = new ArrayList<Bitmap>();

    mList.add(null);
    mAdapter = new ImageAddAdapter(getApplicationContext(), mList);

    mImageTools = new ImageTools(this);

    mHttpClient = new AppHttpClient(NONSTANDAR_PRODUCT_ADD);
    initData();
  }
Exemple #18
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // setTheme(SampleList.THEME); //Used for theme switching in samples
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragment_tabs_pager);

    mTabHost = (TabHost) findViewById(android.R.id.tabhost);
    mTabHost.setup();

    mViewPager = (ViewPager) findViewById(R.id.pager);

    mTabsAdapter = new TabsAdapter(this, mTabHost, mViewPager);

    mTabsAdapter.addTab(
        mTabHost.newTabSpec("offices").setIndicator("Offices"),
        LoaderCursorSupport.CursorLoaderListFragment.class,
        null);
    mTabsAdapter.addTab(
        mTabHost.newTabSpec("agents").setIndicator("Agents"),
        LoaderCursorSupport.CursorLoaderListFragment.class,
        null);

    if (savedInstanceState != null) {
      mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
    }
  }
Exemple #19
0
  @Override
  public void onCreate(Bundle savedInstance) {

    super.onCreate(savedInstance);
    subreddit = getIntent().getExtras().getString("subreddit", "");

    getTheme().applyStyle(new ColorPreferences(this).getThemeSubreddit(subreddit), true);
    getTheme().applyStyle(new FontPreferences(this).getFontStyle().getResId(), true);
    setContentView(R.layout.activity_slidetabs);

    StyleView.styleActivity(this);

    tabs = (TabLayout) findViewById(R.id.sliding_tabs);
    tabs.setTabMode(TabLayout.MODE_SCROLLABLE);
    android.support.v7.widget.Toolbar toolbar =
        (android.support.v7.widget.Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle("/r/" + subreddit + " wiki");
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    pager = (ViewPager) findViewById(R.id.contentView);
    findViewById(R.id.header).setBackgroundColor(Pallete.getColor(subreddit));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      Window window = getWindow();
      window.setStatusBarColor(Pallete.getDarkerColor(subreddit));
    }

    new AsyncGetWiki().execute();
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.setting_main);
   ((ViewStub) findViewById(R.id.set_server_set)).inflate();
   initServerView();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Params.TAG_FG_DEBUG && fgDebugLocal) {
      Log.i(Params.TAG_GEN, TAG_LOCAL + "Start GPS");
    }
    ;

    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
      if (Params.TAG_FG_DEBUG && fgDebugLocal) {
        Log.i(Params.TAG_GEN, TAG_LOCAL + "GPS - OK");
      }
      ;
      // Toast.makeText(getApplicationContext(), "GPS actif", Toast.LENGTH_LONG).show();
      fgGPSActif = true;
    } else {
      if (Params.TAG_FG_DEBUG && fgDebugLocal) {
        Log.i(Params.TAG_GEN, TAG_LOCAL + "GPS - NO");
      }
      ;
      // Toast.makeText(getApplicationContext(), "GPS inactif", Toast.LENGTH_LONG).show();
      fgGPSActif = false;
      // Intent intent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
      // startActivityForResult(intent, 1000);
    }
    if (fgGPSActif) {
      locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
    }
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_register);
   initView();
   setListener();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.trace_layout);
    listView = (PullListView) findViewById(R.id.lv_trace);
    View emptyView = getLayoutInflater().inflate(R.layout.layout_empty_view, null);
    TextView tvIndicator = (TextView) emptyView.findViewById(R.id.tv_empty);
    tvIndicator.setText("观看记录为空");
    listView.setEmptyView(emptyView);
    tvTitle.setText("我看过的主播");
    mUser = ApplicationEx.get().getUserManager().getUser();
    //		bitmapLoad=Utils.getBitmapLoad(this,false);
    asyncImageLoader = new AsyncImageLoader();
    if (mUser != null) {
      getHostAtt();
    }
    getLocalAttHost();
    listView.setOnItemClickListener(
        new AdapterView.OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (parent.getAdapter() != null) {
              Intent intent = new Intent(TraceHostSeeActivity.this, ChatRoomActivity.class);
              intent.putExtra("host", (Father) parent.getAdapter().getItem(position));
              startActivity(intent);
            }
          }
        });
  }
Exemple #24
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   initLocation();
   mLocationClient.start(); // 开始定位
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_invitation);
   mLocationClient = new LocationClient(getApplicationContext());
   initViews();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsingToolbarLayout);
    backdrop = (ImageView) findViewById(R.id.backdrop);
    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    recyclerView.setLayoutManager(
        new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.setItemAnimator(new DefaultItemAnimator());

    int id = getIntent().getIntExtra("ID", 0);

    TheMovieDBDetailsApi.getInstance()
        .getMovieDetails(
            id,
            new TheMovieDBDetailsApi.NetworkResponseListener() {
              @Override
              public void onSuccess(final MovieDetails details) {
                runOnUiThread(
                    new Runnable() {
                      @Override
                      public void run() {
                        setData(details);
                      }
                    });
              }

              @Override
              public void onFailure(Request request, IOException e) {}
            });
  }
Exemple #27
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    App.appContext = StartActivity.this;

    load();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    resourceId = R.layout.activity_setting;
    super.onCreate(savedInstanceState);

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

    // creating pending intent
    pendingIntent =
        PendingIntent.getActivity(
            this,
            0,
            new Intent(getApplicationContext(), this.getClass())
                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY),
            0);

    i[0] = new IntentFilter(NfcAdapter.ACTION_TAG_DISCOVERED);
    // creating tech list for tag
    techListsArray =
        new String[][] {
          new String[] {
            NfcV.class.getName(),
            NfcA.class.getName(),
            NfcB.class.getName(),
            NfcF.class.getName(),
            Ndef.class.getName(),
            NdefFormatable.class.getName(),
            MifareClassic.class.getName(),
            MifareUltralight.class.getName()
          }
        };

    // creating object of nfc adapter of mobile device
    NFCAdapter = NfcAdapter.getDefaultAdapter(this);

    // if app is opened after pop up....
    ScanTag(getIntent());
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.buttons);

    final Button buttonOne = (Button) findViewById(R.id.button_1);
    final Button buttonTwo = (Button) findViewById(R.id.button_2);
    final Button buttonThree = (Button) findViewById(R.id.button_3);

    buttonOne.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            getCommands().keyPress(Code.KEYCODE_1);
          }
        });

    buttonTwo.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            getCommands().keyPress(Code.KEYCODE_2);
          }
        });

    buttonThree.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            getCommands().keyPress(Code.KEYCODE_3);
          }
        });
  }