1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 16:40:32 +00:00

Use view binding in DownloadActivity.

This commit is contained in:
Isira Seneviratne 2020-10-31 13:41:01 +05:30
parent 4545b8e92d
commit a65ed7e914
2 changed files with 11 additions and 6 deletions

View File

@ -9,10 +9,10 @@ import android.view.ViewTreeObserver;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.databinding.ActivityDownloaderBinding;
import org.schabi.newpipe.util.DeviceUtils; import org.schabi.newpipe.util.DeviceUtils;
import org.schabi.newpipe.util.ThemeHelper; import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.views.FocusOverlayView; import org.schabi.newpipe.views.FocusOverlayView;
@ -35,11 +35,14 @@ public class DownloadActivity extends AppCompatActivity {
assureCorrectAppLanguage(this); assureCorrectAppLanguage(this);
ThemeHelper.setTheme(this); ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_downloader);
final Toolbar toolbar = findViewById(R.id.toolbar); super.onCreate(savedInstanceState);
setSupportActionBar(toolbar);
final ActivityDownloaderBinding downloaderBinding =
ActivityDownloaderBinding.inflate(getLayoutInflater());
setContentView(downloaderBinding.getRoot());
setSupportActionBar(downloaderBinding.toolbarLayout.toolbar);
final ActionBar actionBar = getSupportActionBar(); final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) { if (actionBar != null) {

View File

@ -3,7 +3,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/toolbar_layout" /> <include
layout="@layout/toolbar_layout"
android:id="@+id/toolbar_layout" />
<FrameLayout <FrameLayout
android:id="@+id/frame" android:id="@+id/frame"