Kaydet (Commit) 382f9f74 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

tdf#106317 bottom tabbar, grow/shrink font, insert line,rect

- added some initial implementation of the bottom tab-bar, which
  has 3 tabs - character, paragraph, insert

- insert has not (completely) working insert line and rect shapes

- add ability to shring/grow font as alternative to select its size

Change-Id: If039f985403a8155d1e011953043f2979b4bfa91
üst 088fb93a
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="m17,9.219 l0,-4.313 2.281,2.313 0.719,-0.719 -3.281,-3.281 -0.219,-0.219 -0.219,0.219 -3.281,3.281 0.719,0.719 2.281,-2.313 0,4.313 1,0z"
android:fillAlpha="1"
android:strokeColor="#00000000"
android:fillColor="#1d99f3"/>
<path
android:pathData="m8.911,5 l-3.315,9.594 -0.123,0.406 -1.473,4 1.657,0 1.627,-4.438 5.432,0 1.627,4.438 1.657,0 -1.473,-4 -0.123,-0.406 -3.315,-9.594 -0.215,0 -1.749,0 -0.215,0zM10.015,6.938 L12.194,13.281 7.806,13.281 10.015,6.938z"
android:fillAlpha="1"
android:strokeColor="#00000000"
android:fillColor="#4d4d4d"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M4,11h16v2h-16z"
android:fillAlpha="1"
android:strokeColor="#00000000"
android:fillColor="#4d4d4d"
android:strokeWidth="2"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M4,6h16v12h-16z"
android:fillAlpha="0.99"
android:strokeColor="#00000000"
android:fillColor="#4d4d4d"
android:strokeWidth="4"
android:strokeAlpha="0.99"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="m16,14.781 l0,4.313 -2.281,-2.313 -0.719,0.719 3.281,3.281 0.219,0.219 0.219,-0.219 3.281,-3.281 -0.719,-0.719 -2.281,2.313 0,-4.313 -1,0z"
android:fillAlpha="1"
android:strokeColor="#00000000"
android:fillColor="#1d99f3"/>
<path
android:pathData="m8.91,5 l-3.314,9.594 -0.123,0.406 -1.473,4 1.658,0 1.625,-4.438c-0.004,-0.001 7.111,0.004 7.111,0.004l-3.305,-9.566 -0.215,0 -1.75,0zM10.016,6.938 L12.195,13.281 7.805,13.281z"
android:fillAlpha="1"
android:strokeColor="#00000000"
android:fillColor="#4d4d4d"/>
</vector>
......@@ -8,4 +8,5 @@
<dimen name="file_icon_margin_end">8dp</dimen>
<dimen name="list_item_margin">8dp</dimen>
<dimen name="file_icon_width">32dp</dimen>
<dimen name="toolbar_height">256dp</dimen>
</resources>
......@@ -15,7 +15,6 @@ import org.libreoffice.kit.Document;
mContext = context;
mContext.findViewById(R.id.button_insertFormatListBullets).setOnClickListener(this);
mContext.findViewById(R.id.button_insertFormatListNumbering).setOnClickListener(this);
mContext.findViewById(R.id.button_bold).setOnClickListener(this);
......@@ -27,6 +26,12 @@ import org.libreoffice.kit.Document;
mContext.findViewById(R.id.button_align_center).setOnClickListener(this);
mContext.findViewById(R.id.button_align_right).setOnClickListener(this);
mContext.findViewById(R.id.button_align_justify).setOnClickListener(this);
mContext.findViewById(R.id.button_insert_line).setOnClickListener(this);
mContext.findViewById(R.id.button_insert_rect).setOnClickListener(this);
mContext.findViewById(R.id.button_font_shrink).setOnClickListener(this);
mContext.findViewById(R.id.button_font_grow).setOnClickListener(this);
}
@Override
......@@ -73,6 +78,18 @@ import org.libreoffice.kit.Document;
case R.id.button_align_justify:
LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:JustifyPara"));
break;
case R.id.button_insert_line:
LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Line"));
break;
case R.id.button_insert_rect:
LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Rect"));
break;
case R.id.button_font_shrink:
LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Shrink"));
break;
case R.id.button_font_grow:
LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Grow"));
break;
}
}
......
......@@ -23,6 +23,7 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TabHost;
import android.widget.Toast;
import org.libreoffice.overlay.DocumentOverlay;
......@@ -95,6 +96,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
private boolean isFormattingToolbarOpen = false;
private boolean isSearchToolbarOpen = false;
private boolean isDocumentChanged = false;
@Override
public void onCreate(Bundle savedInstanceState) {
Log.w(LOGTAG, "onCreate..");
......@@ -185,6 +187,24 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
mDocumentOverlay = new DocumentOverlay(this, layerView);
mToolbarController.setupToolbars();
TabHost host = (TabHost) findViewById(R.id.toolbarTabHost);
host.setup();
TabHost.TabSpec spec = host.newTabSpec("Character");
spec.setContent(R.id.tab_character);
spec.setIndicator("Character");
host.addTab(spec);
spec = host.newTabSpec("Paragraph");
spec.setContent(R.id.tab_paragraph);
spec.setIndicator("Paragraph");
host.addTab(spec);
spec = host.newTabSpec("Insert");
spec.setContent(R.id.tab_insert);
spec.setIndicator("Insert");
host.addTab(spec);
}
public RectF getCurrentCursorPosition() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment