-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redesign home and hooks page
- Loading branch information
Showing
49 changed files
with
1,596 additions
and
1,025 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
43 changes: 43 additions & 0 deletions
43
app/src/main/java/sh/siava/pixelxpert/ui/fragments/BaseFragment.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,43 @@ | ||
package sh.siava.pixelxpert.ui.fragments; | ||
|
||
import android.os.Bundle; | ||
import android.view.View; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.appcompat.widget.Toolbar; | ||
import androidx.fragment.app.Fragment; | ||
|
||
import sh.siava.pixelxpert.R; | ||
|
||
abstract class BaseFragment extends Fragment { | ||
|
||
protected boolean isBackButtonEnabled() { | ||
return true; | ||
} | ||
|
||
public boolean getBackButtonEnabled() { | ||
return isBackButtonEnabled(); | ||
} | ||
|
||
public abstract String getTitle(); | ||
|
||
@Override | ||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | ||
super.onViewCreated(view, savedInstanceState); | ||
|
||
AppCompatActivity baseContext = (AppCompatActivity) getContext(); | ||
Toolbar toolbar = view.findViewById(R.id.toolbar); | ||
|
||
if (baseContext != null) { | ||
if (toolbar != null) { | ||
baseContext.setSupportActionBar(toolbar); | ||
toolbar.setTitle(getTitle()); | ||
} | ||
if (baseContext.getSupportActionBar() != null) { | ||
baseContext.getSupportActionBar().setDisplayHomeAsUpEnabled(getBackButtonEnabled()); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.