Exemplo n.º 1
0
  @Override
  protected void initView(@Nullable Bundle savedInstanceState) {
    setContentView(R.layout.activity_comment_list);
    ButterKnife.bind(this);

    mToolbar.setTitleTextColor(Color.WHITE);
    setSupportActionBar(mToolbar);
    mToolbar.setTitle("评论");
    mToolbar.setNavigationIcon(R.drawable.ic_actionbar_back);

    mRecyclerView.setHasFixedSize(false);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

    mSwipeRefreshLayout.setColorSchemeResources(
        android.R.color.holo_blue_bright,
        android.R.color.holo_green_light,
        android.R.color.holo_orange_light,
        android.R.color.holo_red_light);

    mSwipeRefreshLayout.setOnRefreshListener(
        () -> {
          if (isFromFreshNews) {
            mAdapter.loadData4FreshNews();
          } else {
            mAdapter.loadData();
          }
        });
  }
  /** to initialise the UI */
  private void initUI() {

    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    toolbar.setTitleTextColor(getResources().getColor(R.color.white));
    txtBusId = (TextView) findViewById(R.id.tripsummary_bus_txt);
    txtTime = (TextView) findViewById(R.id.tripsummary_time_txt);
    txtFrom = (TextView) findViewById(R.id.tripsummary_from_txt);
    txtTo = (TextView) findViewById(R.id.tripsummary_to_txt);
    txtTotalNoOfStudents = (TextView) findViewById(R.id.tripsummary_total_txt);
    txtNoOfStudentsBoarded = (TextView) findViewById(R.id.tripsummary_boarded_txt);
    txtNoOfStudentsMissed = (TextView) findViewById(R.id.tripsummary_missed_txt);
    // txtMessage= (TextView)findViewById(R.id.summary_studentsmessgae_txt);

    txtBusId.setText(mItem.getVehicleId());
    txtTime.setText(mItem.getPlannedStartTime() + " - " + mItem.getPlannedEndTime());
    txtFrom.setText(mItem.getFromArea());
    txtTo.setText(mItem.getPlannedEndTime());
    txtTotalNoOfStudents.setText(db_student.getStudentsList().size() + "");
    txtNoOfStudentsBoarded.setText(db_student.getStudentsListWhereTrue().size() + "");
    txtNoOfStudentsMissed.setText(
        (db_student.getStudentsList().size() - (db_student.getStudentsListWhereTrue().size()))
            + "");
    // txtMessage.setText("Trip succesfully updated in server");
  }
 private void initToolBar() {
   toolbar = (Toolbar) findViewById(R.id.toolbar);
   setSupportActionBar(toolbar);
   toolbar.setTitle("关于驱动器");
   toolbar.setTitleTextColor(getResources().getColor(R.color.white));
   if (typeNum == AboutQudongActivity.PRODUCT_NOTEBOOK) {
     toolbar.setSubtitle("产品手册");
   } else if (typeNum == AboutQudongActivity.ORDER_NOTEBOOK) {
     toolbar.setSubtitle("指令手册");
   } else if (typeNum == AboutQudongActivity.TEST_NOTEBOOK) {
     toolbar.setSubtitle("调试软件手册");
   } else if (typeNum == AboutQudongActivity.QAA_NOTEBOOK) {
     toolbar.setSubtitle("常见问题");
   }
   toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_48dp);
   toolbar.setNavigationOnClickListener(
       new View.OnClickListener() {
         @Override
         public void onClick(View v) {
           Intent intent = new Intent(NoteBookActivity.this, AboutQudongActivity.class); // 方法1
           startActivity(intent);
           finish();
         }
       });
   toolbar.setOnMenuItemClickListener(onMenuItemClick);
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_editor);
    ButterKnife.bind(this);

    setSupportActionBar(editorToolbar);
    editorToolbar.setNavigationIcon(R.mipmap.ic_back);
    editorToolbar.setTitleTextColor(getResources().getColor(R.color.white));
    editorToolbar.setNavigationOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            finish();
          }
        });

    Intent intent = getIntent();
    List<Editor> list = new ArrayList<Editor>();
    Bundle bundle = new Bundle();
    bundle = intent.getBundleExtra("EditorList");
    list = bundle.getParcelableArrayList("EditorList");
    EditorListFragment editorListFragment = new EditorListFragment();
    editorListFragment.setData(list);
    getSupportFragmentManager()
        .beginTransaction()
        .replace(R.id.editor_fragment_container, editorListFragment)
        .commit();
  }
Exemplo n.º 5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sleep);
    Realm realm = Realm.getDefaultInstance();

    Toolbar tb = (Toolbar) findViewById(R.id.toolbar);
    tb.setTitle("Sleep Summaries");
    setSupportActionBar(tb);

    if (getSupportActionBar() != null) {
      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
      getSupportActionBar().setDisplayShowHomeEnabled(true);
      final Drawable upArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
      upArrow.setColorFilter(Color.parseColor("#FFFFFF"), PorterDuff.Mode.SRC_ATOP);
      getSupportActionBar().setHomeAsUpIndicator(upArrow);
      tb.setTitleTextColor(Color.WHITE);
    }

    tb.setNavigationOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            onBackPressed();
          }
        });

    // Get all sleep data recorded and send this to adapter to populate the list

    RealmResults<Sleep> sleeps = realm.where(Sleep.class).findAll();
    sleeps.sort("startTime", Sort.DESCENDING);
    SleepAdapter sleepAdapter = new SleepAdapter(this, R.id.listView, sleeps, true);
    ListView listView = (ListView) findViewById(R.id.listView);
    listView.setAdapter(sleepAdapter);
  }
Exemplo n.º 6
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    /*getSupportActionBar().setTitle("Event Details");
    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);*/
    setContentView(R.layout.event_detail_view);

    ButterKnife.bind(this);

    Bundle b = this.getIntent().getExtras();
    Event event = (Event) b.getSerializable("curItem");

    lblTitle.setText(event.getTitle());
    lblEventDetail.setText(
        "From " + event.getStartdate() + " till " + event.getEnddate() + " at " + event.getCity());
    U.LoadImage(this, iv, event.getImgName());

    ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
    viewPager.setAdapter(new SampleFragmentPagerAdapter(getSupportFragmentManager(), event));

    PagerSlidingTabStrip tabsStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    tabsStrip.setShouldExpand(true);
    tabsStrip.setViewPager(viewPager);
    tabsStrip.setShouldExpand(false);

    final Toolbar advToolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
    advToolbar.setTitle("Event Detail");
    advToolbar.setTitleTextColor(R.color.colorPrimaryDark);
    advToolbar.inflateMenu(R.menu.advance_search);
  }
Exemplo n.º 7
0
  private void makeactionbar() {
    toolbar = (Toolbar) findViewById(R.id.tool_bar);
    toolbar.setTitleTextColor(getResources().getColor(R.color.colorPrimaryDark));
    toolbar.setLogo(getResources().getDrawable(R.drawable.ic_launcher));
    setSupportActionBar(toolbar);

    abdt =
        new ActionBarDrawerToggle(this, dl, R.string.drawer_open, R.string.drawer_close) {

          @Override
          public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            getSupportActionBar().setTitle("Navigation");
            invalidateOptionsMenu();
          }

          @Override
          public void onDrawerClosed(View drawerView) {
            super.onDrawerClosed(drawerView);
            getSupportActionBar().setTitle("COZA Social");
            invalidateOptionsMenu();
          }
        };
    dl.setDrawerListener(abdt);
    abdt.setDrawerIndicatorEnabled(true);
  }
Exemplo n.º 8
0
  private void setUI() {

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

    if (toolbar != null) {
      toolbar.setTitleTextColor(getResources().getColor(R.color.white));
    }

    TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
    tabLayout.addTab(tabLayout.newTab().setText(R.string.current_task)); // создание вкладок
    tabLayout.addTab(tabLayout.newTab().setText(R.string.done_task)); // создание вкладок

    final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
    TabAdapter tabAdapter = new TabAdapter(fragmentManager, 2); // 2 - кол-во вкладок

    viewPager.setAdapter(tabAdapter);
    viewPager.addOnPageChangeListener(
        new TabLayout.TabLayoutOnPageChangeListener(
            tabLayout)); // слушатель на смены события вкладок

    tabLayout.setOnTabSelectedListener(
        new TabLayout.OnTabSelectedListener() {
          @Override
          public void onTabSelected(TabLayout.Tab tab) {
            viewPager.setCurrentItem(
                tab.getPosition()); // передаем необходимый для отображения фрагмент
          }

          @Override
          public void onTabUnselected(TabLayout.Tab tab) {}

          @Override // выбран ранее выбранный таб
          public void onTabReselected(TabLayout.Tab tab) {}
        });
  }
Exemplo n.º 9
0
  private void initToolBar() {
    toolbar.setTitleTextColor(Color.parseColor("#ffffff")); // 设置标题颜色
    toolbar.setLogo(R.mipmap.ic_launcher);
    setSupportActionBar(toolbar);

    //        getSupportActionBar().setDisplayHomeAsUpEnabled(true);//返回键是否显示
    //        getSupportActionBar().setHomeButtonEnabled(true);//应用图标是否可以点击,此api在toolbar中好像没有效果,待验证
    //        getSupportActionBar().setDisplayShowHomeEnabled(true);//应用图标是否显示
    mDrawerToggle =
        new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.open, R.string.close) {
          @Override
          public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            //                mAnimationDrawable.stop();
          }

          @Override
          public void onDrawerClosed(View drawerView) {
            super.onDrawerClosed(drawerView);
            //                mAnimationDrawable.start();
          }
        };

    mDrawerToggle.syncState();
    drawerLayout.setDrawerListener(mDrawerToggle);

    drawerLayout.setDrawerShadow(R.drawable.navigation_drawer_shadow, GravityCompat.START);
    //        drawerLayout.setDrawerListener(openDrawerListener);

  }
Exemplo n.º 10
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    getDelegate().installViewFactory();
    getDelegate().onCreate(savedInstanceState);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.preferences_layout);

    // Pokreni toolbar u preferences aktivnosti
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_preferences);
    setSupportActionBar(toolbar);
    toolbar.setBackgroundColor(Color.parseColor("#F5F5F5"));
    toolbar.setTitleTextColor(Color.parseColor("#666666"));
    toolbar.setNavigationIcon(R.drawable.ic_keyboard_arrow_left_black_24dp);
    // Sta se dogadja kada korisnik klikne na back dugmic u toolbaru
    toolbar.setNavigationOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {

            // Ponovo pokreni glavnu aktivnost ovaj put sa novim postavkama
            Intent restartMainActivity = new Intent(Preferences.this, MainActivity.class);
            startActivity(restartMainActivity);
          }
        });

    // Dodaj Postavke fragment kao glavni sadrzaj u preferences aktivnosti
    getFragmentManager().beginTransaction().replace(R.id.prefsFragment, new Postavke()).commit();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_interview_question);

    ButterKnife.bind(this);

    tid = getIntent().getIntExtra(PARAM_ID, 1);

    toolbar.setTitleTextColor(getResources().getColor(R.color.white));
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowHomeEnabled(true);

    adapter = new InterviewQuestionAdapter(this, this);
    linearLayoutManager = new LinearLayoutManager(this);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setAdapter(adapter);

    recyclerView.addOnScrollListener(
        new RecyclerView.OnScrollListener() {
          @Override
          public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            int lastPosition = linearLayoutManager.findLastCompletelyVisibleItemPosition();
            if ((lastPosition == linearLayoutManager.getItemCount() - 1) && dy > 0) {
              presenter.loadMoreJobItems(tid);
            }
          }
        });

    presenter.firstTimeLoadJobItems(tid);
  }
Exemplo n.º 12
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_touristic_point);

    // Toolbar
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitleTextColor(Color.WHITE);
    toolbar.setSubtitleTextColor(Color.WHITE);
    setSupportActionBar(toolbar);

    // Create the adapter that will return a fragment for each of the sections of the activity.
    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.container);
    mViewPager.setAdapter(mSectionsPagerAdapter);
    mViewPager.addOnPageChangeListener(this);

    // Tabs
    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(mViewPager);

    // Recebendo dados da outra activity
    Intent intent = getIntent();
    int id = intent.getExtras().getInt("id");
    touristicPoint = DatabaseDAO.getInstance().getTouristicPointByID(id);
  }
Exemplo n.º 13
0
 private void initView() {
   mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
   mToolbar = (Toolbar) findViewById(R.id.toolbar);
   mToolbar.setTitle("RecyclerView Demo");
   mToolbar.setTitleTextColor(Color.parseColor("#FFFFFF"));
   setSupportActionBar(mToolbar);
 }
  private void configureToolbar() {
    Toolbar toolbar = getToolbar();
    if (toolbar != null) {
      //            toolbar.setBackgroundColor(Color.parseColor("#1d1d25"));
      toolbar.setTitleTextColor(Color.WHITE);
      //            toolbar.setBackgroundColor(Color.TRANSPARENT);
      //            toolbar.setBottom(Color.WHITE);
      //            if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
      //                Window window = getActivity().getWindow();
      //                window.setStatusBarColor(Color.parseColor("#1d1d25"));
      //            }
      Drawable drawable = null;
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        drawable =
            getResources()
                .getDrawable(R.drawable.dap_wallet_asset_issuer_action_bar_gradient_colors, null);
        toolbar.setElevation(0);
      } else {
        drawable =
            getResources()
                .getDrawable(R.drawable.dap_wallet_asset_issuer_action_bar_gradient_colors);
      }

      toolbar.setBackground(drawable);
    }
  }
Exemplo n.º 15
0
 private void initToolbar() {
   toolbar = (Toolbar) findViewById(R.id.toolbar);
   setSupportActionBar(toolbar);
   getSupportActionBar().setTitle("品牌选择");
   toolbar.setTitleTextColor(Color.WHITE);
   getSupportActionBar().setHomeButtonEnabled(true);
   getSupportActionBar().setDisplayHomeAsUpEnabled(true);
 }
Exemplo n.º 16
0
 private void setDrawerLayout() {
   toolbar.setTitle("QingLuan");
   toolbar.setTitleTextColor(Color.rgb(48, 48, 48));
   setSupportActionBar(toolbar);
   drawerToggle =
       new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.open, R.string.close);
   drawerLayout.addDrawerListener(drawerToggle);
 }
 private void setToolBar() {
   Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
   toolbar.setTitle("图片");
   //        toolbar.setNavigationIcon();
   toolbar.setTitleTextColor(Color.WHITE);
   //        toolbar.setNavigationIcon(R.drawable.abc_);
   setSupportActionBar(toolbar);
 }
Exemplo n.º 18
0
 @Override
 protected void initToolbarAndMenu() {
   super.initToolbarAndMenu();
   toolbar.setTitleTextColor(getResources().getColor(R.color.white));
   toolbar_center_title.setText(menuEntity.title);
   setSupportActionBar(toolbar);
   getSupportActionBar().setDisplayHomeAsUpEnabled(true);
   getSupportActionBar().setDisplayShowTitleEnabled(false);
 }
  @TargetApi(Build.VERSION_CODES.LOLLIPOP)
  private void initToolbar() {
    toolbar = (Toolbar) findViewById(R.id.app_bar);
    toolbar.setTitle("");
    toolbar.setTitleTextColor(Color.WHITE);
    TextView textView = (TextView) toolbar.findViewById(R.id.mytext_appbar);
    textView.setText(R.string.policy);
    //        toolbar.setElevation(10);

    setSupportActionBar(toolbar);
  }
  private void configureToolbar() {
    Toolbar toolbar = getToolbar();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
      toolbar.setBackground(
          getResources().getDrawable(R.drawable.cbw_action_bar_gradient_colors, null));
    else
      toolbar.setBackground(getResources().getDrawable(R.drawable.cbw_action_bar_gradient_colors));

    toolbar.setTitleTextColor(Color.WHITE);
    if (toolbar.getMenu() != null) toolbar.getMenu().clear();
  }
Exemplo n.º 21
0
 private void configureToolbar() {
   toolbar = getToolbar();
   if (toolbar != null) {
     toolbar.setBackgroundColor(getResources().getColor(R.color.dap_user_wallet_principal));
     toolbar.setTitleTextColor(Color.WHITE);
     toolbar.setBottom(Color.WHITE);
     if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
       Window window = getActivity().getWindow();
       window.setStatusBarColor(getResources().getColor(R.color.dap_user_wallet_principal));
     }
   }
 }
Exemplo n.º 22
0
 @Override
 public void initToolbar() {
   setSupportActionBar(toolbar);
   toolbar.setTitleTextColor(Color.WHITE);
   toolbar.setOnMenuItemClickListener(this);
   toolbar.setNavigationOnClickListener(
       new View.OnClickListener() {
         @Override
         public void onClick(View v) {
           close();
         }
       });
 }
Exemplo n.º 23
0
 private void setupToolbar() {
   toolbar.setTitleTextColor(getResources().getColor(R.color.toolbarText));
   toolbar.setTitle(getString(R.string.compose));
   setSupportActionBar(toolbar);
   getSupportActionBar().setDisplayHomeAsUpEnabled(true);
   getSupportActionBar().setDisplayShowHomeEnabled(true);
   toolbar.setNavigationOnClickListener(
       new View.OnClickListener() {
         @Override
         public void onClick(View v) {
           finish();
         }
       });
 }
Exemplo n.º 24
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_invite);
    ButterKnife.bind(this);

    CacheHolder.registration_pool.add(this);

    toolbar.setTitleTextColor(getResources().getColor(R.color.white));
    toolbar.setTitle("SIGN UP");
    setSupportActionBar(toolbar);

    ActionBar bar = getSupportActionBar();
  }
 private void updateTitleColor(float progress) {
   int alpha = 0;
   if (progress <= 1) {
     alpha = (int) (progress * 255);
   } else {
     alpha = 255;
   }
   toolbar.setTitleTextColor(
       Color.argb(
           alpha,
           Color.red(toolbarTitleColor),
           Color.green(toolbarTitleColor),
           Color.blue(toolbarTitleColor)));
 }
Exemplo n.º 26
0
  @TargetApi(Build.VERSION_CODES.LOLLIPOP)
  private void initToolbar() {
    toolbar = (Toolbar) findViewById(R.id.app_bar);
    toolbar.setTitle("");
    toolbar.setTitleTextColor(Color.WHITE);
    TextView textView = (TextView) toolbar.findViewById(R.id.mytext_appbar);
    textView.setText("Joined Rides");
    //        toolbar.setElevation(10);

    setSupportActionBar(toolbar);

    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
Exemplo n.º 27
0
 public void initToolbarWithBack(String title) {
   Toolbar toolbar = (android.support.v7.widget.Toolbar) this.findViewById(R.id.toolbar);
   toolbar.setTitle(title); // 标题的文字需在setSupportActionBar之前,不然会无效
   toolbar.setTitleTextColor(Color.WHITE);
   this.setSupportActionBar(toolbar);
   toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
   toolbar.setNavigationOnClickListener(
       new View.OnClickListener() {
         @Override
         public void onClick(View view) {
           finish();
         }
       });
 }
Exemplo n.º 28
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.inject(this);

    // Creating The Toolbar and setting it as the Toolbar for the activity
    toolbar = (Toolbar) findViewById(R.id.tool_bar);
    setSupportActionBar(toolbar);
    toolbar.setTitleTextColor(getResources().getColor(R.color.text_color));

    ParseAnalytics.trackAppOpenedInBackground(getIntent());
    ParseUser currentUser = ParseUser.getCurrentUser();

    if (currentUser == null) {
      navigateToLogin();
    } else {
      Log.i(TAG, currentUser.getUsername());
    }

    // Creating The ViewPagerAdapter and Passing Fragment Manager, Titles fot the Tabs and Number Of
    // Tabs.
    adapter = new ViewPagerAdapter(getSupportFragmentManager(), Titles, Numboftabs);

    // Assigning ViewPager View and setting the adapter
    pager = (ViewPager) findViewById(R.id.pager);
    pager.setAdapter(adapter);

    // Assiging the Sliding Tab Layout View
    tabs = (SlidingTabLayout) findViewById(R.id.tabs);

    tabs.setDistributeEvenly(
        true); // To make the Tabs Fixed set this true, This makes the tabs Space Evenly in
               // Available width

    // Setting Custom Color for the Scroll bar indicator of the Tab View
    tabs.setCustomTabColorizer(
        new SlidingTabLayout.TabColorizer() {

          @Override
          public int getIndicatorColor(int position) {
            return getResources().getColor(R.color.tabsScrollColor);
          }
        });

    // Setting the ViewPager For the SlidingTabsLayout
    tabs.setViewPager(pager);
  }
Exemplo n.º 29
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_post);
    descriptionView = (EditText) findViewById(R.id.post_main_description);
    imageView = (ImageView) findViewById(R.id.post_main_image);

    post = (Post) getIntent().getSerializableExtra("post");
    Toolbar toolbar = (Toolbar) findViewById(R.id.post_toolbar);
    toolbar.setTitle(post.getTitle());
    toolbar.setTitleTextColor(getResources().getColor(R.color.white));
    setSupportActionBar(toolbar);

    descriptionView.setText(post.getDescription());
    imageView.setImageBitmap(NewPostDialogFragment.tempBitmap);
  }
Exemplo n.º 30
0
 private void configureToolbar() {
   Toolbar toolbar = getToolbar();
   if (toolbar != null) {
     toolbar.setTitleTextColor(Color.WHITE);
     toolbar.setBackgroundColor(Color.TRANSPARENT);
     toolbar.setBottom(Color.WHITE);
     Drawable drawable = null;
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
       drawable =
           getResources()
               .getDrawable(R.drawable.dap_wallet_asset_issuer_action_bar_gradient_colors, null);
     else
       drawable =
           getResources()
               .getDrawable(R.drawable.dap_wallet_asset_issuer_action_bar_gradient_colors);
     toolbar.setBackground(drawable);
   }
 }