Fixed Snackbar behind keyboard on ImportKeysActivity

This commit is contained in:
Manoj Khanna
2015-03-20 18:35:20 +05:30
parent 4e4b8efd6e
commit fa8d5657be
2 changed files with 24 additions and 9 deletions

View File

@@ -26,6 +26,7 @@ import android.os.Messenger;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
@@ -277,7 +278,8 @@ public class ImportKeysActivity extends BaseActivity {
private boolean isFingerprintValid(String fingerprint) {
if (fingerprint == null || fingerprint.length() < 40) {
Notify.create(this, R.string.import_qr_code_too_short_fingerprint, Notify.Style.ERROR).show();
Notify.create(this, R.string.import_qr_code_too_short_fingerprint, Notify.Style.ERROR)
.show((ViewGroup) findViewById(R.id.import_snackbar));
return false;
} else {
return true;
@@ -329,7 +331,8 @@ public class ImportKeysActivity extends BaseActivity {
return;
}
result.createNotify(ImportKeysActivity.this).show();
result.createNotify(ImportKeysActivity.this)
.show((ViewGroup) findViewById(R.id.import_snackbar));
}
}
};
@@ -372,7 +375,8 @@ public class ImportKeysActivity extends BaseActivity {
startService(intent);
} catch (IOException e) {
Log.e(Constants.TAG, "Problem writing cache file", e);
Notify.create(this, "Problem writing cache file!", Notify.Style.ERROR).show();
Notify.create(this, "Problem writing cache file!", Notify.Style.ERROR)
.show((ViewGroup) findViewById(R.id.import_snackbar));
}
} else if (ls instanceof ImportKeysListFragment.CloudLoaderState) {
ImportKeysListFragment.CloudLoaderState sls = (ImportKeysListFragment.CloudLoaderState) ls;
@@ -412,7 +416,8 @@ public class ImportKeysActivity extends BaseActivity {
// start service with intent
startService(intent);
} else {
Notify.create(this, R.string.error_nothing_import, Notify.Style.ERROR).show();
Notify.create(this, R.string.error_nothing_import, Notify.Style.ERROR)
.show((ViewGroup) findViewById(R.id.import_snackbar));
}
}