|
|
@@ -0,0 +1,61 @@
|
|
|
+package com.usai.apex;
|
|
|
+
|
|
|
+import android.content.Intent;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.support.v7.app.ActionBar;
|
|
|
+import android.support.v7.app.AppCompatActivity;
|
|
|
+import android.view.Gravity;
|
|
|
+import android.view.LayoutInflater;
|
|
|
+import android.view.MenuItem;
|
|
|
+import android.view.View;
|
|
|
+import android.widget.TextView;
|
|
|
+
|
|
|
+public class ContainerSearchActivity extends AppCompatActivity {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onCreate(Bundle savedInstanceState) {
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
+ setContentView(R.layout.activity_container_search);
|
|
|
+
|
|
|
+ setCustomActionBar();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setCustomActionBar() {
|
|
|
+ ActionBar.LayoutParams lp =new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.MATCH_PARENT, Gravity.CENTER);
|
|
|
+ View mActionBarView = LayoutInflater.from(this).inflate(R.layout.actionbar_customtitle, null);
|
|
|
+
|
|
|
+ TextView titleview = mActionBarView.findViewById(R.id.title);
|
|
|
+ titleview.setText(getIntent().getStringExtra("title"));
|
|
|
+//
|
|
|
+// mActionBarView.setBackgroundColor(Color.YELLOW);
|
|
|
+// titleview.setBackgroundColor(Color.BLUE);
|
|
|
+ ActionBar actionBar = getSupportActionBar();
|
|
|
+ actionBar.setCustomView(mActionBarView, lp);
|
|
|
+ actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
|
|
+ actionBar.setDisplayShowCustomEnabled(true);
|
|
|
+ actionBar.setDisplayHomeAsUpEnabled(true);
|
|
|
+
|
|
|
+
|
|
|
+// actionBar.setIcon(getNumberDrawable());
|
|
|
+// actionBar.setDisplayShowHomeEnabled(true);
|
|
|
+ actionBar.setDisplayShowTitleEnabled(false);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean onOptionsItemSelected(MenuItem item)
|
|
|
+ {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ switch (item.getItemId())
|
|
|
+ {
|
|
|
+ case android.R.id.home:
|
|
|
+ finish();
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return super.onOptionsItemSelected(item);
|
|
|
+ }
|
|
|
+}
|