Skip to content

Commit

Permalink
Merge pull request #16 from wordpress-mobile/issue/android-remove-sou…
Browse files Browse the repository at this point in the history
…rce-view

[Android] Remove source view
  • Loading branch information
mzorz authored Apr 24, 2018
2 parents 03f2d99 + 5e8fc8f commit 83bb161
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 107 deletions.
18 changes: 9 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
buildscript {
ext {
gradlePluginVersion = '3.0.1'
kotlinVersion = '1.2.30'
supportLibVersion = '26.1.0'
kotlinVersion = '1.2.31'
supportLibVersion = '27.1.1'
tagSoupVersion = '1.2.1'
glideVersion = '3.7.0'
picassoVersion = '2.5.2'
robolectricVersion = '3.5.1'
jUnitVersion = '4.12'
jSoupVersion = '1.10.3'
wordpressUtilsVersion = '1.18.1'
wordpressUtilsVersion = '1.20.2'
espressoVersion = '3.0.1'
}

Expand All @@ -34,13 +34,13 @@ List<String> dirs = [
'template'] // boilerplate code that is generated by the sample template process

android {
compileSdkVersion 26
compileSdkVersion 27

buildToolsVersion "26.0.2"

defaultConfig {
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 27

ndk {
abiFilters "armeabi-v7a", "x86"
Expand Down Expand Up @@ -77,10 +77,10 @@ repositories {
}

dependencies {
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.2')
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:glide-loader:v1.3.2')
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-shortcodes:v1.3.2')
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-comments:v1.3.2')
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:5ca08f37cf6b2372cf4c454322ec47466c2bd033')
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-shortcodes:5ca08f37cf6b2372cf4c454322ec47466c2bd033')
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-comments:5ca08f37cf6b2372cf4c454322ec47466c2bd033')
api ('com.github.wordpress-mobile.WordPress-Aztec-Android:glide-loader:5ca08f37cf6b2372cf4c454322ec47466c2bd033')

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.view.LayoutInflater;
import android.view.View;

import org.wordpress.mobile.ReactNativeAztec.R;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.common.MapBuilder;
Expand All @@ -28,7 +27,6 @@

import org.jetbrains.annotations.NotNull;
import org.wordpress.aztec.ITextFormat;
import org.wordpress.aztec.source.SourceViewEditText;
import org.wordpress.aztec.toolbar.AztecToolbar;
import org.wordpress.aztec.toolbar.IAztecToolbarClickListener;

Expand All @@ -55,19 +53,16 @@ protected ReactAztecView createViewInstance(ThemedReactContext reactContext) {
ReactAztecView aztecView = (ReactAztecView) li.inflate(R.layout.aztec_main, null);
ReactAztecText aztecText = aztecView.findViewById(R.id.aztec);
aztecView.setAztecText(aztecText);
SourceViewEditText sourceEditor = aztecView.findViewById(R.id.source);
aztecView.setSourceEditor(sourceEditor);
AztecToolbar toolbar = aztecView.findViewById(R.id.formatting_toolbar);
aztecView.setToolbar(toolbar);

// init Toolbar
toolbar.setEditor(aztecText, sourceEditor);
toolbar.setEditor(aztecText, null);
toolbar.setToolbarListener(new ToolbarClickListener(aztecView));
aztecText.setToolbar(toolbar);
//initSourceEditorHistory();

aztecText.setCalypsoMode(false);
sourceEditor.setCalypsoMode(false);

return aztecView;
}
Expand Down Expand Up @@ -113,7 +108,6 @@ public Map<String, Object> getExportedCustomBubblingEventTypeConstants() {
@ReactProp(name = "text")
public void setText(ReactAztecView view, String text) {
view.getAztecText().fromHtml(text);
view.getSourceEditor().displayStyledAndFormattedHtml(text);
}

@ReactProp(name = "color")
Expand Down Expand Up @@ -270,7 +264,7 @@ public void onToolbarHeadingButtonClicked() {

@Override
public void onToolbarHtmlButtonClicked() {
mAztecView.getToolbar().toggleEditorMode();
//mAztecView.getToolbar().toggleEditorMode();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
import android.util.AttributeSet;
import android.widget.RelativeLayout;

import org.wordpress.aztec.source.SourceViewEditText;
import org.wordpress.aztec.toolbar.AztecToolbar;

public class ReactAztecView extends RelativeLayout {
private ReactAztecText mAztecText;
private SourceViewEditText mSourceEditor;
private AztecToolbar mToolbar;

public ReactAztecView(Context ctx) {
Expand All @@ -28,14 +26,6 @@ void setAztecText(ReactAztecText aztecText) {
this.mAztecText = aztecText;
}

public SourceViewEditText getSourceEditor() {
return mSourceEditor;
}

public void setSourceEditor(SourceViewEditText mSourceEditor) {
this.mSourceEditor = mSourceEditor;
}

public AztecToolbar getToolbar() {
return mToolbar;
}
Expand Down
20 changes: 0 additions & 20 deletions android/src/main/res/layout/aztec_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,5 @@
android:focusableInTouchMode="true"
aztec:historyEnable="true"
aztec:historySize="10"/>

<org.wordpress.aztec.source.SourceViewEditText
android:id="@+id/source"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top|start"
android:hint="Test"
android:inputType="textNoSuggestions|textMultiLine"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:textSize="14sp"
android:visibility="gone"
android:imeOptions="flagNoExtractUi"
aztec:codeBackgroundColor="@android:color/transparent"
aztec:codeTextColor="@android:color/black"/>

</FrameLayout>
</org.wordpress.mobile.ReactNativeAztec.ReactAztecView>
56 changes: 0 additions & 56 deletions example/android/app/src/main/res/layout/aztec_main.xml

This file was deleted.

6 changes: 3 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
buildscript {
ext {
gradlePluginVersion = '3.0.1'
kotlinVersion = '1.2.30'
supportLibVersion = '26.1.0'
kotlinVersion = '1.2.31'
supportLibVersion = '27.1.1'
tagSoupVersion = '1.2.1'
glideVersion = '3.7.0'
picassoVersion = '2.5.2'
robolectricVersion = '3.5.1'
jUnitVersion = '4.12'
jSoupVersion = '1.10.3'
wordpressUtilsVersion = '1.18.1'
wordpressUtilsVersion = '1.20.2'
espressoVersion = '3.0.1'
}

Expand Down

0 comments on commit 83bb161

Please sign in to comment.