From c4da6ed88b61fc5f79a3193de33f290e753aa376 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Sun, 20 Mar 2016 22:18:40 -0400 Subject: [PATCH] Better Add to Homescreen on Android Adds standalone screen, and top-bar color and background color on splash screen --- app/controllers/manifest_json_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/manifest_json_controller.rb b/app/controllers/manifest_json_controller.rb index 5462ec1fd63..8c7b6bc42b4 100644 --- a/app/controllers/manifest_json_controller.rb +++ b/app/controllers/manifest_json_controller.rb @@ -1,13 +1,15 @@ class ManifestJsonController < ApplicationController layout false - skip_before_filter :preload_json, :check_xhr + skip_before_filter :preload_json, :check_xhr, :redirect_to_login_if_required def index manifest = { short_name: SiteSetting.title, - display: 'browser', + display: 'standalone', orientation: 'portrait', - start_url: "#{Discourse.base_uri}/" + start_url: "#{Discourse.base_uri}/", + background_color: "##{ColorScheme.hex_for_name('secondary')}", + theme_color: "##{ColorScheme.hex_for_name('header_background')}" } render json: manifest.to_json