android-actionbar

Height of screen without status bar, actionBar and tabs

梦想与她 提交于 2019-12-04 23:35:41
I have a ListView that I want each row to fill a third of the available screen. I have the status bar visible, and then an actionBar with slidingTabs beneath. I'm doing the current calculation like this: height = context.getResources().getDisplayMetrics().heightPixels; if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) { actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,context.getResources().getDisplayMetrics()); Log.d("actionBarHeigth", actionBarHeight.toString()); } And setting the views height like this: holder.imageView.getLayoutParams().height

Tab Bar in Android

老子叫甜甜 提交于 2019-12-04 22:38:02
With the help of these program, I created the Tabs. you can look at a below Codes. HomeActivity.java: package com.sit.fth.activity; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.content.Intent; import android.os.Bundle; import android.support.v4.view.ViewPager; import android.util.Log; import android.view.WindowManager; public class HomeActivity extends BaseActivity implements VideoFragment.OnVideoSelectedListener, AboutFragment.OnAboutFragmentSelectedListener, AnnouncenentFragment.OnAnnouncementSelectedListener, GalleryFragment.OnGalItemSelectedListener,

TextView on Action Bar

旧巷老猫 提交于 2019-12-04 21:53:27
I am trying to add a textView on the actionBar which I can dynamically edit. Why is the below code not working???? <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" style="@style/TextMedium" android:paddingLeft="5dp" android:singleLine="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="marquee" /> In the onCreate method of activity, View addView = getLayoutInflater().inflate(R.layout.spinner_select_text, null); actionBar.setCustomView(addView,new ActionBar

AppCompat v7:21 Split Action Bar Broken?

余生颓废 提交于 2019-12-04 21:36:45
问题 I am currently developing an application in which I use a heavily modified Split Action Bar. Here is a link to the app's current state: You'll notice a transparent action bar up top, with a custom view inflated into it, with a hacked together split action bar on bottom. The bottom view is actually a single action item with a custom view inflated into it and showAlways=true. Currently I only support SDK v15+ and I don't really plan on changing that, but with the Lollipop AppCompat library that

How to make SearchView that covers the entire ActionBar/Toolbar

梦想的初衷 提交于 2019-12-04 20:52:37
How does one create this? If you try using a Toolbar and you have inflated MenuItems you'll quickly find out that your Toolbar layout will shrink in width so it does not overlay the MenuItems. The only thing that comes to mind is inflating a layout and adding it to the Window as an overlay that sits on top of the ActionBar. Remember, this is not a problem if you do not need to inflate MenuItems in your Toolbar/ActionBar as then you are given the full width to occupy. So I went with the route of adding my view as an overlay. /** * A Material themed search view that should be overlayed on the

Issue with ActionBarActivityDelegate class…app doesn't run

情到浓时终转凉″ 提交于 2019-12-04 20:32:12
问题 Hello i hope someone can help me with his I was planning to put an action bar in my test app, so I did exactly as said in the developers API guide. But when i tried to compile it it throw this error (logcat): java.lang.ExceptionInInitializerError at android.support.v7.app.ActionBarActivityDelegate.createDelegate() at android.support.v7.app.ActionBarActivity.onCreate()..... ..... Caused by: java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$attr at android.support.v7.app

How to set space on left&right of the logo in the actionBar ?

自闭症网瘾萝莉.ら 提交于 2019-12-04 20:03:22
Background I want to show a bitmap on the left side of the title of the activity, in the actionbar (toolbar, to be exact), so I used this: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setLogo(R.mipmap.ic_launcher); ... The problem Thing is, the logo seems to have too much margin on its left, while the title text is very near the logo itself, so it looks like this: This is not symmetrical at all.

Android ActionBar is hidden with DroidGap (PhoneGap/ Cordova)

别说谁变了你拦得住时间么 提交于 2019-12-04 19:59:02
i just spent some hours on making the Actionbar visible without success: With my RegisterActivity i collect some login data and then i start MainActivity. In RegisterActivity i have a Actionbar but not in MainActivity: AndroidManifest: <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="17"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name="RegisterActivity" android:label="@string/app_name" android:theme="@android:style/Theme.Holo" > <intent-filter> <action android:name="android.intent.action.MAIN

How to customize ActionBar in Android (ActionbarSherlock)?

主宰稳场 提交于 2019-12-04 19:46:16
I have used ActionBarSherlock in my application for providing ActionBars to pre honeycomb devices. I want to use Light.DarkActionBar Theme in, How can I customize following for parts of the ActionBar (see image) Background color of ActionBar Background Image for ActionBar tab bar The bottom line which represents the selected tab The divider between tabs... I have tried using following settings, Though I have achieved some success but the result however doesn't look as expected, <item name="android:background">@drawable/bg_title_bar</item> <item name="background">@drawable/bg_title_bar</item>

ActionBar in API 8-10 in Android

人走茶凉 提交于 2019-12-04 19:39:41
i want to use ActionBar in API level 8-10. i search solutions and find out 2 links bellow, but they are not useful for me.is there someone who has the same experience?Thanks! this is my code: ActionBar actionBar =getActionBar(); assert actionBar != null; actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#e32238"))); link1 link2 when i run the proje,these errors are shown: ActionBar added in Android 3.0 (API level 11), but you can use it in ealier API 11 by using Spport Library. To use support library for Action Bar, your activity should extends ActionBarActivity. To custom