简体   繁体   中英

View text in Android layout that was previously black by default now suddenly grey by default. Cannot work out what's changed

I've Encountered a problem that's had me pulling out my hair a couple of days, and Googling plus searching here hasn't turned up anyone that seems to have encountered the same thing. I learned Java at university but I'm just starting to learn Android recently. I'm working at a school at the moment and have been building a basic educational quiz app in my spare time to play with kids in class, but I've run into some layout behaviour I just don't understand.

When I started this app, text was always black, or at least such a dark grey I couldn't really tell the difference. Every Activity I laid out had nice, dark text. I was modifying one of these to add TextView labels on top of some progress bars a couple days ago, and noticed the text on the labels seemed a bit paler than usual, but dismissed it as AA since the font was so small, and all the previously-added components were still nice and dark. However, when I went on to layout another, new Activity after that, the text colour of every TextView I added was the same medium grey from the labels before. I can manually set the colour of these labels individually to whatever I like and they change, but I don't see why I should have to do this for every new View in every new Activity while the pre-existing ones still work as expected. I don't understand why they're defaulting differently.

I tried setting "@color/black" in the app theme "AppTheme", which I previously had never touched, and while that made the text turn black, it broke disabling buttons, in that they would stay black instead of change colour when disabled, so still looked active. Plus, I'd rather understand what's gone wrong than kludge over it, anyway.

So, can anyone tell my why the TextView text in the first of the following layouts defaults to a sort of medium grey, while the text in the second defaults to black? I can't see what the difference is, and they even have the same nested layout structure, but they render in different colours...

New Activity layout, renders weirdly grey:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".QuestionResultsPageActivity">

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/activity_horizontal_margin">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/questionTitleTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/questionTitleTextViewTopMargin"
                android:text="@string/questionTitleTextViewText"
                android:textSize="@dimen/questionTitleTextViewTextSize"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/questionTextTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/questionTitleTextView"
                android:layout_marginLeft="@dimen/controls_horizontal_margin"
                android:layout_marginRight="@dimen/controls_horizontal_margin"
                android:text="@string/questionTextTextViewText"
                android:textSize="@dimen/questionTextTextViewTextSize" />

            <TextView
                android:id="@+id/answerTitleTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/questionTextTextView"
                android:layout_marginTop="@dimen/answerTitleTextViewTopMargin"
                android:text="@string/answerTitleTextViewText"
                android:textSize="@dimen/answerTitleTextViewTextSize"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/answerLetterTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/answerTitleTextView"
                android:layout_marginLeft="@dimen/controls_horizontal_margin"
                android:layout_marginRight="@dimen/answerLabelSpacing"
                android:text="@string/answerLetterTextViewText"
                android:textSize="@dimen/answerLabelTextViewTextSize"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/answerTextTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/answerTitleTextView"
                android:layout_toRightOf="@id/answerLetterTextView"
                android:text="@string/answerTextTextViewText"
                android:textSize="@dimen/answerTextTextViewTextSize" />

            <TextView
                android:id="@+id/resultsTitleTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/answerTextTextView"
                android:layout_marginTop="@dimen/resultsTitleTextViewTopMargin"
                android:text="@string/resultsTitleTextViewText"
                android:textSize="@dimen/resultsTitleTextViewTextSize"
                android:textStyle="bold" />

            <LinearLayout
                android:id="@+id/resultsBlockLinearLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/resultsTitleTextView"
                android:baselineAligned="false"
                android:orientation="horizontal">

                <LinearLayout
                    android:id="@+id/questionResultTeamNamesLinearLayout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/questionResultTeamNameHeadingTextView"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team"
                        android:textSize="@dimen/teamResultsNameTextSize"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 1"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 2"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 3"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_4"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 4"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_5"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 5"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_6"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 6"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_7"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 7"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_8"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 8"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_9"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Team 9"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/questionResultTeamAnswerLetterLinearLayout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_9"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="\?"
                        android:textSize="@dimen/teamResultsNameTextSize"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_4"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_5"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_6"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_7"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_8"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamNameTextView_9"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="A"
                        android:textSize="@dimen/teamResultsNameTextSize" />

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/questionResultTeamTimesLinearLayout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/questionResultTeamTimeHeadingTextView"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Time"
                        android:textSize="@dimen/teamResultsTimeTextSize"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_4"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_5"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_6"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_7"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_8"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamTimeTextView_9"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="123 + 27 = 150"
                        android:textSize="@dimen/teamResultsTimeTextSize" />

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/questionResultTeamScoresLinearLayout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/questionResultTeamScoreHeadingTextView"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Score"
                        android:textSize="@dimen/teamResultsScoreTextSize"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_4"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_5"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_6"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_7"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_8"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                    <TextView
                        android:id="@+id/questionResultTeamScoreTextView_9"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="10 + 1 = 11"
                        android:textSize="@dimen/teamResultsScoreTextSize" />

                </LinearLayout>

            </LinearLayout>

        </RelativeLayout>

    </ScrollView>

    <Button
        android:id="@+id/questionResultOKButton"
        android:layout_width="@dimen/okButtonWidth"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="@dimen/activity_horizontal_margin"
        android:onClick="askNextQuestion"
        android:text="@string/okButtonLabelText"
        android:textSize="@dimen/okButtonLabelTextSize" />

</RelativeLayout>

Actually, curiously, the text on the Button at the bottom of this layout is still dark/black. All TextViews are in it are mid-grey though (even though ones in older activities aren't).

Whoops, no room in post for next layout due to 30K character limit. Will add separately as new answer. Maybe someone can spot what's different.


Oh, and just in case, AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="//REDACTED">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        //ALL DARK, NO PROBS
        <activity
            android:name=".StartPageActivity"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        //ALL DARK, NO PROBS
        <activity
            android:name=".AskQuestionActivity"
            android:screenOrientation="portrait">
        </activity>

        //ALL DARK, NO PROBS
        <activity
            android:name=".TeamEntryActivity"
            android:screenOrientation="portrait">

        </activity>

        //ALL DARK, NO PROBS
        <activity
            android:name=".AnswerEntryActivity"
            android:screenOrientation="portrait">

        </activity>

        //SOME GREY IN RECENT EDITS (in the ProgressBar label TextViews)
        <activity android:name=".GameResultsPageActivity">
            android:screenOrientation="portrait">
        </activity>

        //ALL GREY, WTF?!
        <activity android:name=".QuestionResultsPageActivity">
            android:screenOrientation="portrait">
        </activity>
    </application>

</manifest>

and styles.xml :

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>

    </style>

</resources>

I hadn't touched this until after the problem occurred, when I was trying to fix things. Is that parent theme "Theme.AppCompat.Light.DarkActionBar" the usual default parent? I don't know how I could have changed it but could it be the source of the pale default text colour?

How can I find the default settings provided by the standard themes? (Like "Theme.AppCompat.Light.DarkActionBar"'s primaryTextColor?)

I would really like to understand what has happened here if possible, so I can avoid it in future.

check you AndroidMaifest.xml file and look for the android:theme= line code. Mine looks like this:

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar">
        <activity android:name=".SplashScreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>...........

You can change this by going to your style.xml file and adding addding android:textColorPrimary andr android:textColorSecondary to your desired colors inside of your theme. That will be automatically applied to your whole application. Hope this helps.

And older Activity's layout, renders nicely dark except the TextViews over ProgressBars: (didn't fit in original question...)

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".GameResultsPageActivity">

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_marginBottom="@dimen/activity_horizontal_margin">

        <RelativeLayout
            android:id="@+id/resultsPageLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:id="@+id/gameOverLabel"
                android:text="@string/gameOverLabelText"
                android:textSize="@dimen/gameOverLabelTextSize"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:textStyle="bold"
                android:layout_marginTop="@dimen/activity_vertical_margin"
                android:layout_centerHorizontal="true"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"/>

            <TextView
                android:id="@+id/questionsAnsweredLabel"
                android:text="@string/questionsAnsweredLabelText"
                android:textSize="@dimen/questionAnsweredLabelTextSize"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/gameOverLabel"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="@dimen/controls_horizontal_margin"/>

            <TextView
                android:id="@+id/questionsAnsweredTextView"
                android:text="\?"
                android:textSize="@dimen/questionAnsweredLabelTextSize"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/gameOverLabel"
                android:layout_alignParentRight="true"
                android:layout_marginRight="@dimen/controls_horizontal_margin"/>

            <TextView
                android:id="@+id/finalScoresLabel"
                android:text="@string/finalScoresLabelText"
                android:textSize="@dimen/finalScoresLabelTextSize"
                android:textStyle="bold"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/questionsAnsweredLabel"
                android:layout_marginLeft="@dimen/controls_horizontal_margin"
                android:layout_marginTop="@dimen/question_answer_vertical_spacing"/>

            <RelativeLayout
                android:id="@+id/team1ScoreLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_below="@id/finalScoresLabel">

                <TextView
                    android:id="@+id/teamNameLabel_1"
                    android:text="Large Text"
                    android:textSize="@dimen/finalScoresListTextSize"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_marginLeft="@dimen/controls_horizontal_margin"/>

                <TextView
                    android:id="@+id/teamScoreLabel_1"
                    android:text="X"
                    android:textStyle="bold"
                    android:textSize="@dimen/finalScoresListTextSize"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:layout_marginRight="@dimen/controls_horizontal_margin"/>

                <ProgressBar
                    android:id="@+id/team1ScoreProgressBar"
                    style="@android:style/Widget.ProgressBar.Horizontal"
                    android:progressDrawable="@drawable/gold_progress"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_toRightOf="@id/teamNameLabel_1"
                    android:layout_toLeftOf="@id/teamScoreLabel_1"
                    android:layout_marginLeft="@dimen/resultsPageProgressLRMargins"
                    android:layout_marginRight="@dimen/resultsPageProgressLRMargins"
                    android:max="100"
                    android:progress="90" />

                <TextView
                    android:id="@+id/team1ScorePercentagetextView"
                    android:text="100%"
                    android:textStyle="bold"
                    android:textSize="@dimen/scorePercentageTextSize"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignTop="@id/team1ScoreProgressBar"
                    android:layout_alignBottom="@id/team1ScoreProgressBar"
                    android:layout_alignLeft="@id/team1ScoreProgressBar"
                    android:layout_alignRight="@id/team1ScoreProgressBar"
                    android:gravity="center"/>

                <ProgressBar
                    android:id="@+id/team1TimeProgressBar"
                    style="?android:attr/progressBarStyleHorizontal"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_toRightOf="@id/teamNameLabel_1"
                    android:layout_toLeftOf="@id/teamScoreLabel_1"
                    android:layout_marginLeft="@dimen/resultsPageProgressLRMargins"
                    android:layout_marginRight="@dimen/resultsPageProgressLRMargins"
                    android:layout_below="@id/team1ScoreProgressBar"
                    android:max="100"
                    android:progress="80" />

                <TextView
                    android:id="@+id/team1TimetextView"
                    android:text="123s"
                    android:textStyle="bold"
                    android:textSize="@dimen/timeLabelTextSize"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignTop="@id/team1TimeProgressBar"
                    android:layout_alignBottom="@id/team1TimeProgressBar"
                    android:layout_alignLeft="@id/team1TimeProgressBar"
                    android:layout_alignRight="@id/team1TimeProgressBar"
                    android:gravity="center"/>

            </RelativeLayout>

            //REPEAT NESTED LAYOUTS ABOVE EIGHT MORE TIMES FOR TEAMS 2-9
            //EDITED OUT TO FIT IN ANSWER CHARACTER LIMIT

            <Button
                android:id="@+id/closeResultsButton"
                android:onClick="returnToStartGameActivity"
                android:text="@string/okButtonLabelText"
                android:textSize="@dimen/okButtonLabelTextSize"
                android:textAllCaps="false"
                android:layout_marginBottom="@dimen/controls_vertical_spacing"
                android:layout_width="@dimen/okButtonWidth"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:layout_below="@id/team9ScoreLayout"/>

        </RelativeLayout>

    </ScrollView>

</RelativeLayout>

All the other old Activities render dark, so I have no idea what's going on here. Please help?

Oh, and just in case, AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="//REDACTED">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        //ALL DARK, NO PROBS
        <activity
            android:name=".StartPageActivity"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        //ALL DARK, NO PROBS
        <activity
            android:name=".AskQuestionActivity"
            android:screenOrientation="portrait">
        </activity>

        //ALL DARK, NO PROBS
        <activity
            android:name=".TeamEntryActivity"
            android:screenOrientation="portrait">

        </activity>

        //ALL DARK, NO PROBS
        <activity
            android:name=".AnswerEntryActivity"
            android:screenOrientation="portrait">

        </activity>

        //SOME GREY IN RECENT EDITS (in the ProgressBar label TextViews)
        <activity android:name=".GameResultsPageActivity">
            android:screenOrientation="portrait">
        </activity>

        //ALL GREY, WTF?!
        <activity android:name=".QuestionResultsPageActivity">
            android:screenOrientation="portrait">
        </activity>
    </application>

</manifest>

and styles.xml :

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>

    </style>

</resources>

I hadn't touched this until after the problem occurred, when I was trying to fix things. Is that parent theme "Theme.AppCompat.Light.DarkActionBar" the usual default parent? I don't know how I could have changed it but could it be the source of the pale default text colour?

How can I find the default settings provided by the standard themes? (Like "Theme.AppCompat.Light.DarkActionBar"'s primaryTextColor?)

I would really like to understand what has happened here if possible, so I can avoid it in future.

Edit: Solved

Finally noticed all the dark Views had android:textAppearance="?android:attr/textAppearanceLarge" set. Which apparently darkens the text colour too, even though attr/textAppearanceMedium and attr/textAppearanceSmall don't. Use mostly the "Large Text" insertion button or copy and paste these existing blocks enough and it looks like all text is dark by default. Start a new activity using the "Plain TextView" instead of "Large Text" to insert Views into the tree and suddenly it seems like the default colour has changed. :/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM