Reformated the code and optimized imports
This commit is contained in:
parent
fca3410f26
commit
474ce28737
@ -66,6 +66,7 @@ public class HomeActivity extends Activity {
|
|||||||
*/
|
*/
|
||||||
protected DrawerLayout mDrawerLayout;
|
protected DrawerLayout mDrawerLayout;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -102,6 +103,7 @@ public class HomeActivity extends Activity {
|
|||||||
mDrawerToggle.syncState();
|
mDrawerToggle.syncState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -112,6 +114,7 @@ public class HomeActivity extends Activity {
|
|||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -122,6 +125,7 @@ public class HomeActivity extends Activity {
|
|||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -135,6 +139,7 @@ public class HomeActivity extends Activity {
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -144,6 +149,7 @@ public class HomeActivity extends Activity {
|
|||||||
mDrawerToggle.onConfigurationChanged(newConfig);
|
mDrawerToggle.onConfigurationChanged(newConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -153,6 +159,7 @@ public class HomeActivity extends Activity {
|
|||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -176,6 +183,7 @@ public class HomeActivity extends Activity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -190,6 +198,9 @@ public class HomeActivity extends Activity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
@ -197,7 +208,6 @@ public class HomeActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
public void onEvent(FileSelectedEvent event) {
|
public void onEvent(FileSelectedEvent event) {
|
||||||
@ -213,6 +223,7 @@ public class HomeActivity extends Activity {
|
|||||||
/**
|
/**
|
||||||
* When a file is saved
|
* When a file is saved
|
||||||
* Invoked by the EditorFragment
|
* Invoked by the EditorFragment
|
||||||
|
*
|
||||||
* @param event The event called
|
* @param event The event called
|
||||||
*/
|
*/
|
||||||
public void onEvent(FileSavedEvent event) {
|
public void onEvent(FileSavedEvent event) {
|
||||||
@ -252,6 +263,7 @@ public class HomeActivity extends Activity {
|
|||||||
/**
|
/**
|
||||||
* When a file can't be opened
|
* When a file can't be opened
|
||||||
* Invoked by the EditorFragment
|
* Invoked by the EditorFragment
|
||||||
|
*
|
||||||
* @param event The event called
|
* @param event The event called
|
||||||
*/
|
*/
|
||||||
public void onEvent(ErrorOpeningFileEvent event) {
|
public void onEvent(ErrorOpeningFileEvent event) {
|
||||||
@ -299,11 +311,17 @@ public class HomeActivity extends Activity {
|
|||||||
R.string.nome_app_turbo_editor,
|
R.string.nome_app_turbo_editor,
|
||||||
R.string.nome_app_turbo_editor) {
|
R.string.nome_app_turbo_editor) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onDrawerClosed(View view) {
|
public void onDrawerClosed(View view) {
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onDrawerOpened(View drawerView) {
|
public void onDrawerOpened(View drawerView) {
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
@ -14,6 +14,7 @@ import com.vmihalachi.turboeditor.R;
|
|||||||
|
|
||||||
public class LicensesActivity extends Activity implements AdapterView.OnItemClickListener {
|
public class LicensesActivity extends Activity implements AdapterView.OnItemClickListener {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -27,6 +28,7 @@ public class LicensesActivity extends Activity implements AdapterView.OnItemClic
|
|||||||
listView.setAdapter(adapter);
|
listView.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -30,6 +30,9 @@ import com.vmihalachi.turboeditor.fragment.ChangelogDialogFragment;
|
|||||||
import com.vmihalachi.turboeditor.helper.AppInfoHelper;
|
import com.vmihalachi.turboeditor.helper.AppInfoHelper;
|
||||||
|
|
||||||
public class PreferenceAbout extends PreferenceActivity {
|
public class PreferenceAbout extends PreferenceActivity {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(final Bundle savedInstanceState) {
|
public void onCreate(final Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -44,6 +47,9 @@ public class PreferenceAbout extends PreferenceActivity {
|
|||||||
market = findPreference("aboutactivity_authormarket");
|
market = findPreference("aboutactivity_authormarket");
|
||||||
if (email != null) {
|
if (email != null) {
|
||||||
email.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
email.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(final Preference preference) {
|
public boolean onPreferenceClick(final Preference preference) {
|
||||||
Intent i = new Intent(Intent.ACTION_SEND);
|
Intent i = new Intent(Intent.ACTION_SEND);
|
||||||
@ -61,6 +67,9 @@ public class PreferenceAbout extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
if (changelog != null) {
|
if (changelog != null) {
|
||||||
changelog.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
changelog.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(final Preference preference) {
|
public boolean onPreferenceClick(final Preference preference) {
|
||||||
ChangelogDialogFragment.showChangeLogDialog(getFragmentManager());
|
ChangelogDialogFragment.showChangeLogDialog(getFragmentManager());
|
||||||
@ -70,6 +79,9 @@ public class PreferenceAbout extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
if (open_source_licenses != null) {
|
if (open_source_licenses != null) {
|
||||||
open_source_licenses.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
open_source_licenses.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(final Preference preference) {
|
public boolean onPreferenceClick(final Preference preference) {
|
||||||
startActivity(new Intent(PreferenceAbout.this, LicensesActivity.class));
|
startActivity(new Intent(PreferenceAbout.this, LicensesActivity.class));
|
||||||
@ -79,6 +91,9 @@ public class PreferenceAbout extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
if (market != null) {
|
if (market != null) {
|
||||||
market.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
market.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(final Preference preference) {
|
public boolean onPreferenceClick(final Preference preference) {
|
||||||
try {
|
try {
|
||||||
|
@ -57,6 +57,9 @@ public class SelectFileActivity extends Activity implements AdapterView.OnItemCl
|
|||||||
.getAbsolutePath();
|
.getAbsolutePath();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -85,6 +88,9 @@ public class SelectFileActivity extends Activity implements AdapterView.OnItemCl
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent,
|
public void onItemClick(AdapterView<?> parent,
|
||||||
View view, int position, long id) {
|
View view, int position, long id) {
|
||||||
@ -106,6 +112,9 @@ public class SelectFileActivity extends Activity implements AdapterView.OnItemCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.activity_select_file, menu);
|
getMenuInflater().inflate(R.menu.activity_select_file, menu);
|
||||||
@ -114,6 +123,9 @@ public class SelectFileActivity extends Activity implements AdapterView.OnItemCl
|
|||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int i = item.getItemId();
|
int i = item.getItemId();
|
||||||
@ -145,6 +157,9 @@ public class SelectFileActivity extends Activity implements AdapterView.OnItemCl
|
|||||||
private class UpdateList extends
|
private class UpdateList extends
|
||||||
AsyncTask<String, Void, LinkedList<AdapterDetailedList.FileDetail>> {
|
AsyncTask<String, Void, LinkedList<AdapterDetailedList.FileDetail>> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected LinkedList<AdapterDetailedList.FileDetail> doInBackground(final String... params) {
|
protected LinkedList<AdapterDetailedList.FileDetail> doInBackground(final String... params) {
|
||||||
try {
|
try {
|
||||||
@ -196,6 +211,9 @@ public class SelectFileActivity extends Activity implements AdapterView.OnItemCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(final LinkedList<AdapterDetailedList.FileDetail> names) {
|
protected void onPostExecute(final LinkedList<AdapterDetailedList.FileDetail> names) {
|
||||||
boolean isRoot = currentFolder.equals("/");
|
boolean isRoot = currentFolder.equals("/");
|
||||||
@ -207,6 +225,9 @@ public class SelectFileActivity extends Activity implements AdapterView.OnItemCl
|
|||||||
|
|
||||||
public final Comparator<File> getFileNameComparator() {
|
public final Comparator<File> getFileNameComparator() {
|
||||||
return new AlphanumComparator() {
|
return new AlphanumComparator() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getTheString(Object obj) {
|
public String getTheString(Object obj) {
|
||||||
return ((File) obj).getName()
|
return ((File) obj).getName()
|
||||||
|
@ -73,6 +73,9 @@ public class AdapterDetailedList extends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public View getView(final int position,
|
public View getView(final int position,
|
||||||
View convertView, final ViewGroup parent) {
|
View convertView, final ViewGroup parent) {
|
||||||
@ -109,29 +112,22 @@ public class AdapterDetailedList extends
|
|||||||
final String ext = FilenameUtils.getExtension(fileName);
|
final String ext = FilenameUtils.getExtension(fileName);
|
||||||
if (fileDetail.isFolder()) {
|
if (fileDetail.isFolder()) {
|
||||||
viewHolder.icon.setImageResource(R.color.file_folder);
|
viewHolder.icon.setImageResource(R.color.file_folder);
|
||||||
}
|
} else if (Arrays.asList(MimeTypes.MIME_HTML).contains(ext) || ext.endsWith("html")) {
|
||||||
else if (Arrays.asList(MimeTypes.MIME_HTML).contains(ext) || ext.endsWith("html")) {
|
|
||||||
viewHolder.icon.setImageResource(R.color.file_html);
|
viewHolder.icon.setImageResource(R.color.file_html);
|
||||||
}
|
} else if (Arrays.asList(MimeTypes.MIME_CODE).contains(ext)
|
||||||
else if (Arrays.asList(MimeTypes.MIME_CODE).contains(ext)
|
|
||||||
|| fileName.endsWith("css")
|
|| fileName.endsWith("css")
|
||||||
|| fileName.endsWith("js")) {
|
|| fileName.endsWith("js")) {
|
||||||
viewHolder.icon.setImageResource(R.color.file_code);
|
viewHolder.icon.setImageResource(R.color.file_code);
|
||||||
}
|
} else if (Arrays.asList(MimeTypes.MIME_ARCHIVE).contains(ext)) {
|
||||||
else if (Arrays.asList(MimeTypes.MIME_ARCHIVE).contains(ext)) {
|
|
||||||
viewHolder.icon.setImageResource(R.color.file_archive);
|
viewHolder.icon.setImageResource(R.color.file_archive);
|
||||||
}
|
} else if (Arrays.asList(MimeTypes.MIME_MUSIC)
|
||||||
else if (Arrays.asList(MimeTypes.MIME_MUSIC)
|
|
||||||
.contains(ext)) {
|
.contains(ext)) {
|
||||||
viewHolder.icon.setImageResource(R.color.file_media_music);
|
viewHolder.icon.setImageResource(R.color.file_media_music);
|
||||||
}
|
} else if (Arrays.asList(MimeTypes.MIME_PICTURE).contains(ext)) {
|
||||||
else if (Arrays.asList(MimeTypes.MIME_PICTURE).contains(ext)) {
|
|
||||||
viewHolder.icon.setImageResource(R.color.file_media_picture);
|
viewHolder.icon.setImageResource(R.color.file_media_picture);
|
||||||
}
|
} else if (Arrays.asList(MimeTypes.MIME_VIDEO).contains(ext)) {
|
||||||
else if (Arrays.asList(MimeTypes.MIME_VIDEO).contains(ext)) {
|
|
||||||
viewHolder.icon.setImageResource(R.color.file_media_video);
|
viewHolder.icon.setImageResource(R.color.file_media_video);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
viewHolder.icon.setImageResource(R.color.file_text);
|
viewHolder.icon.setImageResource(R.color.file_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,9 @@ public class ChangelogDialogFragment extends DialogFragment {
|
|||||||
public ChangelogDialogFragment() {
|
public ChangelogDialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
|
|
||||||
@ -54,6 +57,9 @@ public class ChangelogDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.setPositiveButton(R.string.vota, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.vota, new DialogInterface.OnClickListener() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onClick(final DialogInterface dialog, final int which) {
|
public void onClick(final DialogInterface dialog, final int which) {
|
||||||
try {
|
try {
|
||||||
|
@ -89,6 +89,7 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
return frag;
|
return frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -98,6 +99,7 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -110,6 +112,7 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
return rootView;
|
return rootView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -151,6 +154,7 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -185,6 +189,7 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
dialogFrag.show(getFragmentManager().beginTransaction(), "encodingDialog");
|
dialogFrag.show(getFragmentManager().beginTransaction(), "encodingDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -237,6 +242,9 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
|
|
||||||
class SaveFile extends AsyncTask<Void, Void, Void> {
|
class SaveFile extends AsyncTask<Void, Void, Void> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(final Void... voids) {
|
protected Void doInBackground(final Void... voids) {
|
||||||
try {
|
try {
|
||||||
@ -249,6 +257,9 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(final Void aVoid) {
|
protected void onPostExecute(final Void aVoid) {
|
||||||
super.onPostExecute(aVoid);
|
super.onPostExecute(aVoid);
|
||||||
@ -257,7 +268,6 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static class Editor extends EditText {
|
public static class Editor extends EditText {
|
||||||
|
|
||||||
protected static final int
|
protected static final int
|
||||||
@ -300,6 +310,9 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
|
|
||||||
private final Runnable updateRunnable =
|
private final Runnable updateRunnable =
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
replaceTextKeepCursor(getText());
|
replaceTextKeepCursor(getText());
|
||||||
@ -332,6 +345,9 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
// Syntax editor
|
// Syntax editor
|
||||||
setFilters(new InputFilter[]{
|
setFilters(new InputFilter[]{
|
||||||
new InputFilter() {
|
new InputFilter() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CharSequence filter(
|
public CharSequence filter(
|
||||||
CharSequence source,
|
CharSequence source,
|
||||||
@ -355,6 +371,9 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyShortcut(
|
public boolean onKeyShortcut(
|
||||||
final int keyCode, final KeyEvent event) {
|
final int keyCode, final KeyEvent event) {
|
||||||
@ -383,6 +402,9 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
return super.onKeyShortcut(keyCode, event);
|
return super.onKeyShortcut(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onTextContextMenuItem(
|
public boolean onTextContextMenuItem(
|
||||||
final int id) {
|
final int id) {
|
||||||
@ -397,6 +419,9 @@ public class EditorFragment extends Fragment implements EncodingDialogFragment.E
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onDraw(final Canvas canvas) {
|
public void onDraw(final Canvas canvas) {
|
||||||
if (!EditorFragment.sWrapText) {
|
if (!EditorFragment.sWrapText) {
|
||||||
|
@ -48,6 +48,9 @@ public class EncodingDialogFragment extends DialogFragment implements TextView.O
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
|
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
|
||||||
final Bundle savedInstanceState) {
|
final Bundle savedInstanceState) {
|
||||||
@ -68,6 +71,9 @@ public class EncodingDialogFragment extends DialogFragment implements TextView.O
|
|||||||
|
|
||||||
final Button button = (Button) view.findViewById(android.R.id.button1);
|
final Button button = (Button) view.findViewById(android.R.id.button1);
|
||||||
button.setOnClickListener(new View.OnClickListener() {
|
button.setOnClickListener(new View.OnClickListener() {
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onClick(final View v) {
|
public void onClick(final View v) {
|
||||||
returnData();
|
returnData();
|
||||||
@ -86,6 +92,9 @@ public class EncodingDialogFragment extends DialogFragment implements TextView.O
|
|||||||
this.dismiss();
|
this.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
|
public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
|
||||||
if (EditorInfo.IME_ACTION_DONE == actionId) {
|
if (EditorInfo.IME_ACTION_DONE == actionId) {
|
||||||
|
@ -51,6 +51,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
private List<String> fileNames;
|
private List<String> fileNames;
|
||||||
private ArrayAdapter<String> arrayAdapter;
|
private ArrayAdapter<String> arrayAdapter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -61,6 +62,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
return rootView;
|
return rootView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -70,6 +72,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
getListView().setMultiChoiceModeListener(this);
|
getListView().setMultiChoiceModeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -82,6 +85,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
refreshList();
|
refreshList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -92,6 +96,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -106,6 +111,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
EventBus.getDefault().post(new FileSelectedEvent(filePath));
|
EventBus.getDefault().post(new FileSelectedEvent(filePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -113,6 +119,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
public void onItemCheckedStateChanged(ActionMode actionMode, int position, long l, boolean isChecked) {
|
public void onItemCheckedStateChanged(ActionMode actionMode, int position, long l, boolean isChecked) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -123,6 +130,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -131,6 +139,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -162,6 +171,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@ -174,6 +184,7 @@ public class NavigationDrawerListFragment extends ListFragment implements AbsLis
|
|||||||
/**
|
/**
|
||||||
* When a new file is opened
|
* When a new file is opened
|
||||||
* Invoked by the main activity which receive the intent
|
* Invoked by the main activity which receive the intent
|
||||||
|
*
|
||||||
* @param event The event called
|
* @param event The event called
|
||||||
*/
|
*/
|
||||||
public void onEvent(NewFileOpened event) {
|
public void onEvent(NewFileOpened event) {
|
||||||
|
@ -29,6 +29,7 @@ import com.vmihalachi.turboeditor.R;
|
|||||||
|
|
||||||
public class NoFileOpenedFragment extends Fragment {
|
public class NoFileOpenedFragment extends Fragment {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -37,6 +37,9 @@ public class CapitalizedTextView extends TextView {
|
|||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setText(final CharSequence text, final BufferType type) {
|
public void setText(final CharSequence text, final BufferType type) {
|
||||||
super.setText(text.toString().toUpperCase(), type);
|
super.setText(text.toString().toUpperCase(), type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user