Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b0d7f04 authored by Wysie's avatar Wysie
Browse files

Release 1.95. Fixed the pesky FC bug when adding/editing contacts and the user...

Release 1.95. Fixed the pesky FC bug when adding/editing contacts and the user decides to slide out the keyboard.
parent 0d66dc83
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Resources;
@@ -468,6 +469,9 @@ public final class EditContactActivity extends Activity implements View.OnClickL
        }
        
        loadCurrentMembership();
        
        //Wysie_Soh: Testing purposes (Emulate keyboard slide-out/orientation change)
        //this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
    }

    private void setupSections() {
@@ -1943,6 +1947,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL
            focusChild.requestFocus();
            if (focusChild instanceof EditText) {
                // Index ends beyond data length.
                try {
                    if (entry.requestCursor > entry.data.length()) {
                        entry.requestCursor = entry.data.length();
                    }
@@ -1952,6 +1957,10 @@ public final class EditContactActivity extends Activity implements View.OnClickL
                    }
                    ((EditText) focusChild).setSelection(entry.requestCursor);
                }
                catch (NullPointerException e) { //Wysie_Soh: If nothing is entered into the field yet, entry.data.length() will be null.
                    entry.requestCursor = ((EditText) focusChild).getSelectionStart();
                }
            }
        }

        // Reset requested focus values