|
@@ -24,7 +24,6 @@ import java.util.ArrayList;
|
24
|
24
|
import java.util.List;
|
25
|
25
|
|
26
|
26
|
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
27
|
|
-import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
28
|
27
|
|
29
|
28
|
@SuppressLint("ViewConstructor")
|
30
|
29
|
public class TitleBar extends Toolbar {
|
|
@@ -166,12 +165,10 @@ public class TitleBar extends Toolbar {
|
166
|
165
|
}
|
167
|
166
|
|
168
|
167
|
public Toolbar.LayoutParams getComponentLayoutParams(TitleOptions.Alignment alignment) {
|
169
|
|
- if (alignment == TitleOptions.Alignment.Fill) {
|
170
|
|
- return new LayoutParams(MATCH_PARENT, getHeight());
|
171
|
|
- } else {
|
172
|
|
- LayoutParams lp = new LayoutParams(WRAP_CONTENT, getHeight());
|
|
168
|
+ LayoutParams lp = new LayoutParams(MATCH_PARENT, getHeight());
|
|
169
|
+ if (alignment == TitleOptions.Alignment.Center) {
|
173
|
170
|
lp.gravity = Gravity.CENTER;
|
174
|
|
- return lp;
|
175
|
171
|
}
|
|
172
|
+ return lp;
|
176
|
173
|
}
|
177
|
174
|
}
|