-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LegacyEditorFragment now lives in the editor subproject
- Loading branch information
Showing
9 changed files
with
1,238 additions
and
2 deletions.
There are no files selected for viewing
1,015 changes: 1,013 additions & 2 deletions
1,015
WordPressEditor/src/main/java/org/wordpress/android/editor/LegacyEditorFragment.java
Large diffs are not rendered by default.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
WordPressEditor/src/main/java/org/wordpress/android/editor/legacy/EditLinkActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package org.wordpress.android.editor.legacy; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.app.ActionBarActivity; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
|
||
import org.wordpress.android.editor.R; | ||
|
||
public class EditLinkActivity extends ActionBarActivity { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
setContentView(R.layout.alert_create_link); | ||
|
||
Bundle extras = getIntent().getExtras(); | ||
if (extras != null) { | ||
String selectedText = extras.getString("selectedText"); | ||
if (selectedText != null) { | ||
EditText linkTextET = (EditText) findViewById(R.id.linkText); | ||
linkTextET.setText(selectedText); | ||
} | ||
} | ||
|
||
final Button cancelButton = (Button) findViewById(R.id.cancel); | ||
final Button okButton = (Button) findViewById(R.id.ok); | ||
|
||
final EditText urlEditText = (EditText) findViewById(R.id.linkURL); | ||
urlEditText.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
if (urlEditText.getText().toString().equals("")) { | ||
urlEditText.setText("http://"); | ||
urlEditText.setSelection(7); | ||
} | ||
} | ||
|
||
}); | ||
|
||
okButton.setOnClickListener(new Button.OnClickListener() { | ||
public void onClick(View v) { | ||
EditText linkURLET = (EditText) findViewById(R.id.linkURL); | ||
String linkURL = linkURLET.getText().toString(); | ||
|
||
EditText linkTextET = (EditText) findViewById(R.id.linkText); | ||
String linkText = linkTextET.getText().toString(); | ||
|
||
Bundle bundle = new Bundle(); | ||
bundle.putString("linkURL", linkURL); | ||
if (!linkText.equals("")) { | ||
bundle.putString("linkText", linkText); | ||
} | ||
|
||
Intent mIntent = new Intent(); | ||
mIntent.putExtras(bundle); | ||
setResult(RESULT_OK, mIntent); | ||
finish(); | ||
|
||
} | ||
}); | ||
|
||
cancelButton.setOnClickListener(new Button.OnClickListener() { | ||
public void onClick(View v) { | ||
Intent mIntent = new Intent(); | ||
setResult(RESULT_CANCELED, mIntent); | ||
finish(); | ||
} | ||
}); | ||
|
||
// select end of url | ||
urlEditText.performClick(); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:padding="@dimen/margin_medium" | ||
android:layout_gravity="center_vertical"> | ||
|
||
<EditText | ||
android:id="@+id/linkURL" | ||
android:inputType="textUri" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="@string/link_enter_url" | ||
android:imeOptions="actionNext" /> | ||
|
||
<EditText | ||
android:id="@+id/linkText" | ||
android:inputType="text" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@id/linkURL" | ||
android:hint="@string/link_enter_url_text" /> | ||
|
||
<Button | ||
android:id="@+id/ok" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@id/linkText" | ||
android:layout_alignParentRight="true" | ||
android:layout_marginLeft="@dimen/margin_medium" | ||
android:text="@android:string/ok" /> | ||
|
||
<Button | ||
android:id="@+id/cancel" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_alignTop="@id/ok" | ||
android:layout_toLeftOf="@id/ok" | ||
android:text="@android:string/cancel" /> | ||
|
||
</RelativeLayout> |
81 changes: 81 additions & 0 deletions
81
WordPressEditor/src/main/res/layout/alert_image_options.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:padding="10dp" | ||
android:layout_gravity="center_horizontal" | ||
android:gravity="center_horizontal"> | ||
|
||
<EditText | ||
android:id="@+id/title" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="@string/title" | ||
android:singleLine="true"/> | ||
|
||
<EditText | ||
android:id="@+id/caption" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="@string/caption" | ||
android:singleLine="true" | ||
android:inputType="textCapSentences"/> | ||
|
||
<TextView | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/horizontal_alignment" | ||
android:textStyle="bold" | ||
android:textColor="@color/image_options_label"/> | ||
|
||
<Spinner | ||
android:id="@+id/alignment_spinner" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:prompt="@string/image_alignment"/> | ||
|
||
<TextView | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/width" | ||
android:textStyle="bold" | ||
android:textColor="@color/image_options_label"/> | ||
|
||
<SeekBar | ||
android:layout_height="wrap_content" | ||
android:id="@+id/imageWidth" | ||
android:layout_width="match_parent"/> | ||
|
||
<EditText | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:text="" | ||
android:imeOptions="actionDone" | ||
android:id="@+id/imageWidthText" | ||
android:layout_gravity="left|center_vertical" | ||
android:singleLine="true" | ||
android:inputType="number"/> | ||
|
||
<CheckBox | ||
android:layout_gravity="left" | ||
android:text="@string/featured" | ||
android:id="@+id/featuredImage" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:visibility="gone"/> | ||
|
||
<CheckBox | ||
android:layout_gravity="left" | ||
android:text="@string/featured_in_post" | ||
android:id="@+id/featuredInPost" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:visibility="gone"/> | ||
</LinearLayout> | ||
</ScrollView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters