Skip to content

Commit

Permalink
use title/content params in the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Feb 4, 2015
1 parent 9f26eb3 commit cfc3ff0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
2 changes: 2 additions & 0 deletions editor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ android {
dependencies {
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.android.support:support-v4:21.0.+'
releaseCompile project(path:':libs:utils:WordPressUtils', configuration: 'release')
debugCompile project(path:':libs:utils:WordPressUtils', configuration: 'debug')
}

signing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,18 @@
import java.io.InputStreamReader;

public class EditorFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
private static final String ARG_PARAM_TITLE = "param_title";
private static final String ARG_PARAM_CONTENT = "param_content";

// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private String mParamTitle;
private String mParamContent;
private WebView mWebView;

/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment EditorFragment.
*/
// TODO: Rename and change types and number of parameters
public static EditorFragment newInstance(String param1, String param2) {
public static EditorFragment newInstance(String title, String content) {
EditorFragment fragment = new EditorFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
args.putString(ARG_PARAM_TITLE, title);
args.putString(ARG_PARAM_CONTENT, content);
fragment.setArguments(args);
return fragment;
}
Expand All @@ -56,8 +44,8 @@ public EditorFragment() {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
mParamTitle = getArguments().getString(ARG_PARAM_TITLE);
mParamContent = getArguments().getString(ARG_PARAM_CONTENT);
}
}

Expand Down

0 comments on commit cfc3ff0

Please sign in to comment.