forked from Igalia/wolvic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create New Tab page and add an option to set New Tab page as homepage
- Loading branch information
Showing
14 changed files
with
331 additions
and
42 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
42 changes: 42 additions & 0 deletions
42
app/src/common/shared/com/igalia/wolvic/ui/views/NewTabView.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,42 @@ | ||
package com.igalia.wolvic.ui.views; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.content.Context; | ||
import android.view.LayoutInflater; | ||
import android.widget.FrameLayout; | ||
|
||
import androidx.databinding.DataBindingUtil; | ||
|
||
import com.igalia.wolvic.R; | ||
import com.igalia.wolvic.VRBrowserActivity; | ||
import com.igalia.wolvic.databinding.NewTabBinding; | ||
import com.igalia.wolvic.ui.widgets.WidgetManagerDelegate; | ||
|
||
public class NewTabView extends FrameLayout { | ||
|
||
private WidgetManagerDelegate mWidgetManager; | ||
|
||
private NewTabBinding mBinding; | ||
|
||
public NewTabView(Context context) { | ||
super(context); | ||
initialize(); | ||
} | ||
|
||
protected void initialize() { | ||
mWidgetManager = ((VRBrowserActivity) getContext()); | ||
updateUI(); | ||
} | ||
|
||
@SuppressLint("ClickableViewAccessibility") | ||
public void updateUI() { | ||
removeAllViews(); | ||
|
||
LayoutInflater inflater = LayoutInflater.from(getContext()); | ||
|
||
mBinding = DataBindingUtil.inflate(inflater, R.layout.new_tab, this, true); | ||
mBinding.setLifecycleOwner((VRBrowserActivity)getContext()); | ||
|
||
mBinding.executePendingBindings(); | ||
} | ||
} |
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
Oops, something went wrong.