-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rebased some activities and code to make the app more smooth and faster
- Loading branch information
1 parent
4ed60e1
commit 2111859
Showing
8 changed files
with
73 additions
and
106 deletions.
There are no files selected for viewing
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
92 changes: 0 additions & 92 deletions
92
app/src/main/java/in/hridayan/ashell/activities/StartActivity.java
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
app/src/main/java/in/hridayan/ashell/fragments/StartFragment.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,51 @@ | ||
package in.hridayan.ashell.fragments; | ||
|
||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import androidx.appcompat.widget.LinearLayoutCompat; | ||
import androidx.fragment.app.Fragment; | ||
import androidx.preference.PreferenceManager; | ||
import com.google.android.material.bottomnavigation.BottomNavigationView; | ||
import com.google.android.material.button.MaterialButton; | ||
import com.google.android.material.textview.MaterialTextView; | ||
import in.hridayan.ashell.R; | ||
import rikka.shizuku.Shizuku; | ||
|
||
public class StartFragment extends Fragment { | ||
|
||
public StartFragment() {} | ||
|
||
@Override | ||
public View onCreateView( | ||
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
View view = inflater.inflate(R.layout.fragment_start, container, false); | ||
initViews(view); | ||
return view; | ||
} | ||
|
||
private void initViews(View view) { | ||
LinearLayoutCompat mStartLayout = view.findViewById(R.id.fragment_start); | ||
MaterialButton mStartButton = view.findViewById(R.id.start_button); | ||
MaterialTextView mAboutText = view.findViewById(R.id.about_text); | ||
|
||
if (Shizuku.pingBinder()) { | ||
Shizuku.requestPermission(0); | ||
} | ||
mStartLayout.setVisibility(View.VISIBLE); | ||
mAboutText.setText(getString(R.string.app_summary)); | ||
|
||
mStartButton.setOnClickListener( | ||
v -> { | ||
PreferenceManager.getDefaultSharedPreferences(requireContext()) | ||
.edit() | ||
.putBoolean("firstLaunch", false) | ||
.apply(); | ||
getParentFragmentManager() | ||
.beginTransaction() | ||
.replace(R.id.fragment_container, new aShellFragment()) | ||
.commit(); | ||
}); | ||
} | ||
} |
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
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